skip to Main Content

MongoDB match with $all ignore order of given items

I have the following structure in the database: { "_id": ObjectId("6464acb09947e03e45b78b61"), "ProjectId": "64635ac02286d48c0c0d5907", "LabelValues": { "62d12558d75c134f54911490": "Nicht zuzuordnen", "62d12546d75c134f5491148f": "Nicht zuzuordnen" }, "KnowledgeItemId": ObjectId("6464acaf9947e03e45b78b60") } I want to write a query, that gets this element if I pass the two…

VIEW QUESTION

Mongodb – How can I project an object only if a specific field exists?

I have the following documents in my MongoDB Aggregation stage: _id: ObjectId('641316fd596514e63a2121ca'), teamId: 5, playerId: ObjectId('64131139596514e63a2121c1') _id: ObjectId('641316fd596514e63a2121ca'), teamId: 5, playerId: ObjectId('64143f7702ede13fea5ff3be') _id: ObjectId('64143f458b6a6cf54652d3a5'), teamId: 17, playerId: ObjectId('64143fa75a97b9a63a260e16') _id: ObjectId('64143f4f9ba5f2b3cf3030e6'), teamId: 3 I want to create an Object field called…

VIEW QUESTION
Back To Top
Search