Mac client: The below script isn't validating correctly, it claims there's something wrong with the first of my date lines. Am I missing something glaringly obvious or is there a problem with new Date()?
UPDATE: Interestingly, from that Insert record form the command fails, but if I run an update from the collection/code screen new Date() works just fine!
{
customerAccountId: 2501,
voiceRating: [
{rating: 'bad', gte: 0, lt: 30},
{rating: 'warn', gte: 30, to: 60},
{rating: 'iffy', gte: 60, to: 100},
{rating: 'good', gte: 100}
],
dataRating: [
{rating: 'bad', gte: 0, lt: 10},
{rating: 'warn', gte: 10, lt: 100},
{rating: 'iffy', gte: 100, lt: 500},
{rating: 'good', gte: 500}
],
dateCreated: new Date(),
dateUpdated: new Date(),
dateStart: new Date()
}
Hi @zeg-io! This happens because of the editor is a JSON editor and it does not execute any javascript or mongo shell functions. To make it work - you just need to put actual date value like this: ISODate("2016-02-18T00:00:00.000Z")
Most helpful comment
Hi @zeg-io! This happens because of the editor is a JSON editor and it does not execute any javascript or mongo shell functions. To make it work - you just need to put actual date value like this:
ISODate("2016-02-18T00:00:00.000Z")