Skip to content

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

@this-josh

Description

@this-josh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions