I am getting a wrong type error with full text search in pymongo. Could not find anything in the docs to clarify this.
Here is the query:
query={'$search':
{
'index': 'title',
'text': {
'query': 'paper'
}
}
}
result = db.find({ '$text': query } )
I am getting this error:
OperationFailure: "$search" had the wrong type. Expected string, found object, full error: {'operationTime': Timestamp(1629910737, 1), 'ok': 0.0, 'errmsg': '"$search" had the wrong type. Expected string, found object', 'code': 14, 'codeName': 'TypeMismatch', '$clusterTime': {'clusterTime': Timestamp(1629910737, 1), 'signature': {'hash': b'\r\xbe\x067\xea\xfd:#\x9c\x83\x8b\x1e\xac\x15\x8e\x93\xcb\x06=\xe0', 'keyId': 6959643758958739458}}}
It expects a string but I don't understand where.