HelainSchoonjans opened a new issue, #14397:
URL: https://github.com/apache/grails-core/issues/14397
I have a Grails 3.3.2 application with GORM 6.1.8 and am using the mongodDB
grails plugin 6.1.4.
When trying to connect to a 3.4 MongoDB instance, the application makes an
error at startup:
> Caused by: com.mongodb.MongoCommandException: Command failed with error
67: 'Values in v:2 index key pattern cannot be of type bool. Only numbers > 0,
numbers < 0, and strings are allowed.' on server localhost:27017. The full
response is { "ok" : 0.0, "errmsg" : "Values in v:2 index key pattern cannot be
of type bool. Only numbers > 0, numbers < 0, and strings are allowed.", "code"
: 67, "codeName" : "CannotCreateIndex" }
Using the debugger, I could find the domain whose index creation failed:
class MyClass{
Long field1
String field2
Long index
static mapWith = "mongo"
static mapping = {
database "databasename"
}
static constraints = {
field1 nullable: true
field2 nullable: true
}
}
It embedded in another domain.
What's wrong with this domain class? I had the same results with a Mongo 3.6
and 4.0 instance ( I'm using the official mongoDB docker instances ).
PS: finally found it; the index attribute of the domain causes the error;
removing it makes everything work again.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]