MongoDb $setIntersection with Java Driver -


मैं mongodb से जावा ड्रायवर के साथ निम्नलिखित mongodb-json-query को बनाना चाहता हूं:

 < Code> db.item.aggregate ([{$ $ project ': {attr: {$ setIntersection: ["$ structureAttributeValueIdList", [ऑब्जेक्ट ("54bfba08ef6643acaa5be2c9")]]}, _id: 0, दस्तावेज़: "$$ root" }}, {"$ Unwind": "$ attr"}, {"$ match": {"document.stateDeleted": 0}}]);  

मेरे पास अभी तक यह क्या है:

  डीबीओबीजेक्ट प्रतिच्छेदन = नया BasicDBObject ("$ setIntersection", ????); DBObject फ़ील्ड = नया BasicDBObject ("विशेषताएँ", प्रतिच्छेदन); Fields.put ("दस्तावेज़", "$$ रूट"); Fields.put ("_id", 0); डीबीओबीजेक्ट प्रोजेक्ट = नया बेसिक डिबोबाइजेक्ट ("$ प्रोजेक्ट", फ़ील्ड); DBObject खोलना = नया BasicDBObject ("$ unwind", "attributes"); डीबीओबीज मैच = नया बेसिक डिबोबाइजेक्ट ("$ मैच", नया बेसिक डिबोबेस ("document.stateDeleted", 0)); सूची के & lt; DBObject & gt; पाइपलाइन = Arrays.asList (परियोजना, खोलना, मैच); एकत्रीकरण आउटपुट आउटपुट = ऑपरेशंस। डेटाकॉलक्शन ("आइटम")। समग्र (पाइपलाइन);  

लेकिन मैं सेट इन्सेक्शन-पार्ट बनाने का तरीका नहीं जानता हूं! कोई मदद?

धन्यवाद ...

यह मेरे द्वारा मिला ... बहुत आसान है जब आपको पता है कि कैसे

<प्री> मूलभूत बिल्ट सूची चौराह = नया BasicDBList (); IntersectionList.add ("$ structureAttributeValueIdList"); प्रतिच्छेदनलिस्ट.एड (ऑब्जेक्टआईडीडीबीएलआईएस); डीबीओबीजेक्ट प्रतिच्छेदन = नया मूलभूतबॉक्स ("$ सेट इन्सेक्शन", प्रतिच्छेदन सूची);

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -