Query FindAndModify
Closed this issue · 3 comments
jet-snowman commented
Hi All!,
I didn't find in documentation and in code the query "findandmodify". Before I implemented it as select and if not found document then insert but this is not atomic request. Who knows how to do it ?
Thanks!
sboesebeck commented
This is not implemented yet... sorry.
If you implement that, we could include it to the next release...
sboesebeck commented
you can always access the mongo driver directly, getting it via morphium.getDriver()
usually this returns a MorphiumDriver implementation, but you could cast it to Driver, if you want to:
((Driver)morphium.getDriver()).getCollection("name")
and with that, you should be able to do that find and modify.
BUT: caches won't be updated and all callbacks won't work...
jet-snowman commented
I will think about it, because I don't use cache logic. Thanks