microsoft / vscode-cosmosdb

Azure Databases extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-cosmosdb
MIT License
156 stars 67 forks source link

How to query (for Date) #153

Closed Devenda closed 6 years ago

Devenda commented 6 years ago

Hi,

How do you use the scratch book to query your DB for Date? This does not seem to work: db.member.find({ resp_week: { $lt: new Date(), $ne: null } }) resulting in: Unexpected end of input

More in general, is there any documentation on querying (except for the mongo shell docs, which does not suffice for Date query's)?

Kind regards Tinus

PrashanthCorp commented 6 years ago

Did you try db.member.find({ ts: { '$lt': 'new Date()', '$ne': null } }) ? Quotes around the expressions that need to be parsed as JS.

We try to support the mongo shell to the best we can. We feel the mongo shell documentation should be a good reference.

Devenda commented 6 years ago

Indeed that did the trick! Thanks!