Hi I'm trying to build an Update where I pushAll into two arrays in one statement. Can this be done?
Code:db.foo.update({ id : "xxx" }, { $pushAll : { "people" : [{"name":"new person"}], "friends" : [{"name":"new friend"}] } } )
Hi I'm trying to build an Update where I pushAll into two arrays in one statement. Can this be done?
Code:db.foo.update({ id : "xxx" }, { $pushAll : { "people" : [{"name":"new person"}], "friends" : [{"name":"new friend"}] } } )
I fixed it but this should be supported by fwk. Or have I missed something?
Code:private static class MultiPushUpdate extends Update { public MultiPushUpdate multiPushAll(String key, Object... values) { super.addMultiFieldOperation("$pushAll", key, values); return this; } } .... .... Query query = query(where("id").is("xxx")); Update update = new MultiPushUpdate() .multiPushAll("people", people) .multiPushAll("friends", friends);