Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using match with a timeseries database unknown operator: $match #105

Open
this-josh opened this issue Mar 22, 2023 · 0 comments
Open

Comments

@this-josh
Copy link

I'm trying to use match with a timeseries database, but I'm getting this error:

julia> import Mongoc
julia> client = Mongoc.Client()
julia> db = client["my_db"]
julia> col = db["timeseries"]
julia> pipeline = Mongoc.BSON("""
       [
           {
           "\$match": {
               "timestamp": {
                   "\$gte": "2022-01-01T00:00:00",
                   "\$lte": "2022-02-01T00:00:00"
               }
           }
           }
       ]""")
julia> Mongoc.find_one(col, pipeline)
ERROR: BSONError: domain=5, code=2, message=unknown operator: $match
Stacktrace:
 [1] _iterate(cursor::Mongoc.Cursor{Mongoc.Collection}, state::Nothing)
   @ Mongoc ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:690
 [2] _iterate
   @ ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:680 [inlined]
 [3] find_one(collection::Mongoc.Collection, bson_filter::Mongoc.BSON; options::Nothing)
   @ Mongoc ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:332
 [4] find_one(collection::Mongoc.Collection, bson_filter::Mongoc.BSON)
   @ Mongoc ~/.julia/packages/Mongoc/tJNDW/src/collection.jl:327
 [5] top-level scope
   @ REPL[7]:1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant