moped icon indicating copy to clipboard operation
moped copied to clipboard

Top level $query operator does not always work

Open fgarcia opened this issue 10 years ago • 0 comments

Although the $query operator is not always needed, in some cases I do want to write a native query like this:

query = mongo.find("$query" => {:aggregate_id=>"1ZC"}, "$orderby" => { version: 1 })

The query *seems to be OK because this works:

query.to_a

However this fails

  @selector={:count=>"events", :query=>{"$query"=>{:aggregate_id=>"1ZC"}, "$orderby"=>{:version=>1}}}
  @fields=nil>
failed with error 2: "exception: unknown top level operator: $query"

The current implementation seems to ignore that the presence of $query is because the user wants a full blown native query without the find(...).modifier(..) syntax

fgarcia avatar Feb 09 '15 16:02 fgarcia