pymongo 程序中的意外标记“$”
unexpected token '$' in pymongo program
bdnome = collection.find_one({ $text: {$search: vername}})
在这一行,“$text”中出现错误,错误如下
"unexpected token '$'" and "unexpected toke 'text', and a error
appears in "$search" --- "unexpected token '{'" and "unexpected
token '$'" and "unexpected token 'search'", and a error occurs
as well in "vername" --- "unexpected token 'vername".
我在 MongoDB
中使用数据库
您正试图在 Python 中使用 JavaScript 语法。那不行。
bdnome = collection.find_one({ "$text": {"$search": vername}})
bdnome = collection.find_one({ $text: {$search: vername}})
在这一行,“$text”中出现错误,错误如下
"unexpected token '$'" and "unexpected toke 'text', and a error
appears in "$search" --- "unexpected token '{'" and "unexpected
token '$'" and "unexpected token 'search'", and a error occurs
as well in "vername" --- "unexpected token 'vername".
我在 MongoDB
中使用数据库您正试图在 Python 中使用 JavaScript 语法。那不行。
bdnome = collection.find_one({ "$text": {"$search": vername}})