mongox icon indicating copy to clipboard operation
mongox copied to clipboard

Separating raw queries from query builder

Open aminalaee opened this issue 3 years ago • 0 comments

Right now we support both at the same time:

# Raw query
await Movie.query({"name": "X"}).first()

# Query builder
await Movie.query(Movie.name == "X").first()

This leas to complexity handling both in the same method. I'm thinking maybe adding a .raw() method which accepts the query and doesn't do any validation/query building and sends it directly to MongoDB.

aminalaee avatar Nov 22 '21 12:11 aminalaee