Start a new topic

findAndModify in BL seems to have different (and incorrect?) behavior

This possibly broke a while ago, but we've recently noticed that the collectionAccess.findAndModify call has 2 problems:



1) When findAndModify returns with the affected entity/entities it now wraps them in an .entity{} object. This is not serious and is easy to work around, but it would be helpful if such changes were documented.



2) It seems that the 'new' option is being ignored. This option is supposed to return the modified record rather than the original and in the past this worked fine. But now it just returns the original record which is breaking our code. (I can work around it with another lookup of the record, but it would be nice to avoid this.)



Anyone else seen these problems? Please let me know if you have trouble reproducing them.

Thanks for pointing this out Joel. We just released a fix that should revert the behavior back to what it was.
Yes, it does seem to be fixed. Thx. Is that a general fix? Since this affected 2 collectionAccess calls is it possible that the problem will occur with others? (I haven't tested all or noticed a problem, but am curious.)
No, we've gone through and looked at all the calls to make sure that they are behaving as expected. We upgraded an underlying driver which unknowingly changed the behavior of a couple of the method results - namely the ones that return integers from Mongo rather than objects.
Login or Signup to post a comment