sql >> Databasteknik >  >> NoSQL >> MongoDB

Mongoose:Kan inte hämta fildokument från .chunk-samlingen utan datafältet

Jag tror att jag har kommit på det här. Det är möjligt genom metoden distinct() :

// Get the distinct file IDs that correspond to each upload.
db.collection('media.chunks').distinct('files_id', function(error, results){
    console.log('Distinct file ID results',results);
    return res.status(200).send();
});



  1. _http_server.js:192 throw new RangeError(`Ogiltig statuskod:${statusCode}`);

  2. Minska MongoDB-databasfilstorleken

  3. Enkelt sätt att generera kod med Mongoose och Node.js och Underscore?

  4. MongoDB $ln