Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
GridFS API.sortには、DBCursorオブジェクトに似た機能がないようです。
.sort
uploadDate(または他の GridFS メタデータ フィールド)で並べ替える方法はありますか?
uploadDate
fs.files を通常のコレクションとして直接ソートし、結果に基づいて GridFS API でファイルを取得することをお勧めします。
例えば:
var cur = db.fs.files.find({}, {"_id" : true}).sort({"uploadDate" : true})
次に、id 値を使用してファイルを取得できます。