Hi,
I'm using ojai:1.1-mapr-1703 in Scala and I can't force this method from DocumentMutation class:
DocumentMutation setOrReplace(String var1, Map<String, ? extends Object> var2)
to update fields on the root level of the document. For instance using it like this doesn't work:
val updateDocument = MapRDB.newMutation()
val docs = <... a java.util.Map[String, Any] ... >
updateDocument.setOrReplace("", docs)
... update of the database with updateDocument ...
What I get in result are rows like this:
{
"_id": "1",
"field_name1": "aaa",
"field_name2": {
"$numberLong": 111
},
"creationdate": {
"$date": "2019-02-07T13:05:20.101Z"
},
"": {
"field_name1": "bbb",
"field_name2": {
"$numberLong": 222
}
},
"lastmodificationdate": {
"$date": "2019-02-07T13:07:04.060Z"
}
}
Note the "": {...} field in the above JSON. In fact, I wanted the updated row to look like this:
{
"_id": "1",
"creationdate": {
"$date": "2019-02-07T13:05:20.101Z"
},
"field_name1": "bbb",
"field_name2": {
"$numberLong": 222
},
"lastmodificationdate": {
"$date": "2019-02-07T13:07:04.060Z"
}
}
Changing "" to "new FieldPath.EMPTY" doesn't help either. I looked all over FieldPath documentation and couldn't find any alias for the root level of the JSON - does anything like this even exist?
Any help would be appreciated!
Hi,
I'm using ojai:1.1-mapr-1703 in Scala and I can't force this method from DocumentMutation class:
to update fields on the root level of the document. For instance using it like this doesn't work:
What I get in result are rows like this:
Note the "": {...} field in the above JSON. In fact, I wanted the updated row to look like this:
Changing "" to "new FieldPath.EMPTY" doesn't help either. I looked all over FieldPath documentation and couldn't find any alias for the root level of the JSON - does anything like this even exist?
Any help would be appreciated!