You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{code}
{
"_id" : ObjectId("4fbc94fe2bd79a29b335a038"),
"version" : NumberLong(2),
"wc" : 200,
"wordCount" : 100
}
{code}
When updating, another field (the long version corresponding to "wc" field, "wordCount", is created which holds the value "wc" had before the update was done. This happens every time an update is done.
Original Reporter: gabriela
Environment: Not Specified
Version: 1.1.0.GA
Migrated From: http:https://jira.grails.org/browse/GPMONGODB-202
My domain object is:
{code}
class PersonMongoDomain {
Integer wordCount;
static mapWith = "mongo";
}
{code}
{code}
PersonMongoDomain p = new PersonMongoDomain();
p.wordCount = 100;
p.save();
{code}
As a result, in mongo I have :
{code}
{
"_id" : ObjectId("4fbc94fe2bd79a29b335a038"),
"version" : NumberLong(1),
"wc" : 100
}
{code}
{code}
PersonMongoDomain p1 = PersonMongoDomain.createCriteria().get {
eq('wordCount', 100)
}
p1.wordCount = 200;
p1.save();
{code}
As a result, in mongo I have :
{code}
{
"_id" : ObjectId("4fbc94fe2bd79a29b335a038"),
"version" : NumberLong(2),
"wc" : 200,
"wordCount" : 100
}
{code}
When updating, another field (the long version corresponding to "wc" field, "wordCount", is created which holds the value "wc" had before the update was done. This happens every time an update is done.
E.g.
{code}
PersonMongoDomain p1 = PersonMongoDomain.createCriteria().get {
eq('wordCount', 200)
}
p1.wordCount = 300;
p1.save();
{code}
After the code above is executed, the record in mongo will look like this:
{code}
{
"_id" : ObjectId("4fbc94fe2bd79a29b335a038"),
"version" : NumberLong(2),
"wc" : 300,
"wordCount" : 200
}
{code}
The text was updated successfully, but these errors were encountered: