I need to find another way to make this operation : "$setIsSubset" with AWS DocumentDB (MongoDB like).

I'm not an expert with the mongo request, but I need to convert this instruction for my application.

I tried this one toto: {$cond: [{$not: {"$elemMatch": {"$nin" : [[object_id(user._id)], {$ifNull: ["$titi", []]}] }}}, true, false]}, but I have this error : MongoError: Unrecognized expression '$elemMatch'

If anyone have an idea :)

  • I don't think there is a great server-side workaround for implementing aggregation set operators that are currently missing in DocumentDB. You could perform equivalent manipulation in your client code (which won't be as efficient) or consider using a full MongoDB implementation. Set operators like $setIsSubset were added in MongoDB 2.6 (April 2014), so any modern version of MongoDB server will support these. – Stennie Jul 24 '19 at 2:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.