gpt4 book ai didi

javascript - Mongoose : $where unequal

转载 作者:可可西里 更新时间:2023-11-01 09:46:12 25 4
gpt4 key购买 nike

我想使用 mongoosejs 的查询构建器接口(interface)获取一组文档,但没有一组特定的 ID。

=> 所以我正在照顾一些:

var query = Document.find();
query.$where('this._id !== ' + req.session.user_id);
query.exec(cb);

这个例子分解...

但它到底是如何工作的呢?

最佳答案

如果您只是想排除一个 ID:

query.ne('_id', req.session.user_id);

关于javascript - Mongoose : $where unequal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12026634/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com