1

我正在努力将一个简单的 MongoDB 查询转换为 PHP。假设我有以下集合:

{ "_id": 1, "text" : "I agree with you." }  
{ "_id : 2, "text" : "They agreed with him." }  
{ "_id : 3, "text" : "They wrote an agreement." }

在外壳中,如果我输入:

db.collection.find({ text: {$not: /\bagreed\b/i}})

它很好地排除了带有 _id:2 的项目,如下所示:

{ "_id": 1, "text" : "I agree with you." }  
{ "_id : 3, "text" : "They wrote an agreement." }

如何将此简单查询转换为 PHP 中的等效查询?提前致谢。

4

0 回答 0