fdb-document-layer icon indicating copy to clipboard operation
fdb-document-layer copied to clipboard

Keep $elemMatch behavior consistent with MongoDB

Open apkar opened this issue 5 years ago • 0 comments

Document Layer allows $elemMatch to work against nonarray fields, whereas MongoDB allows only on array fields. Array operators semantics are quite confusing already. Although allowing $elemMatch on nonarray fields allows a few extra cases, it's leading to confusing semantics. Also, its possible to represent those extra queries with cleared, arguably longer queries.

This issue is to change the behavior back to supporting the operator only for array fields.

Although this is a backward incompatible change, I think we should go for it as this is a bit consistent for different queries especially when we use it together with None.

apkar avatar Mar 26 '19 22:03 apkar