मैं किसी विशेष लेखक और उसकी संबंधित पुस्तकों को ढूंढने और आउटपुट करने के लिए मीन-पर्यावरण में निम्न मोंगोस क्वेरी का उपयोग करता हूं।मोंगोस/मोंगोडब: जनसंख्या वाले क्वेरी डेटा से फ़ील्ड बहिष्कृत करें
Author
.findOne({personcode: code})
.select('-_id')
.select('-__v')
.populate('bookids') //referencing to book documents in another collection (->array of bookids)
.select('-_id') //this doens't affect the data coming from the bookids-documents
.select('-__v') //this doens't affect the data coming from the bookids-documents
.exec(function (err, data) {
//foo
});
मैं भी "_ id" और बाहरी दस्तावेजों से आ रही आबादी वाले डेटा से "__v" फील्ड छोड़ करना चाहते हैं। यह कैसे प्राप्त किया जा सकता है?
महान! बहुत बहुत धन्यवाद। बस ठीक काम करता है =) –