[Solved] API query question

I’m writing a bot that has to query a user by their username. I’ve been looking in the rocket/mongodb docs and "name": {"$text": "username"} looks like it should work, along with "name": {"$regex": "username"}, but neither do, and I get a error-invalid-query error.

Figured out the issue. Somehow, my client library was messing it up. I manually turned the query into json and it worked.