下面的查詢返回數據,但文檔(db)中不存在hgf字段。如何限制僅對現有字段進行排序?files.find({ account_id: 1, deleted_at: { '$eq': null },
status: { '$ne': 3 }}, { skip: 0, limit: 100, sort: { hgf: -1 }, projection: {} });
Mongoose 允許對不存在的字段進行排序。如何僅限制現有字段?
蠱毒傳說
2022-01-13 15:06:52