Re: Re: How to add current date in RobomongoDB

From: Mane Nilesh <nileshmane1988@xxxxxxxxx>
To: mongodb-user@xxxxxxxxxxxxxxxx
Date: Thu, 5 May 2016 11:14:29 +0530
Why ads?
Thanks Chris.

On Tue, May 3, 2016 at 5:10 AM, Chris Cunningham <
chris.cunningham@xxxxxxxxxxx> wrote:

Nilesh,


After further analysis, it has been found that there is a known issue with
Robomongo that indicates that there is a problem with the way that it
performs JSON validation:


https://github.com/paralect/robomongo/issues/619


It appears that the validation process in Robomongo is not able to use
constructors as per the example I provided.


You may want to reach out to the Robomongo developers to see if they
intend to address this issue in future releases:


https://github.com/paralect/robomongo/issues


Using the Robomongo -> Insert Document function, you will need to specify
a date string in the ISODate() instead of letting the constructor create it
for you as shown in the following example:



{
    "date" : ISODate("2016-05-26T00:00:00.000Z"),
    "userId" : NumberLong(10),
    "name" : "Green Tea with honey",
    "calss" : "BSC-SE",
    "createdAt" : ISODate("2016-05-26T00:00:00.000Z")
}




Alternatively, you can add the document from the command line at the top
of Robomongo using the following example:


db.test.insert({ "date" : ISODate("2016-05-26T00:00:00.000Z"),
    "userId" : NumberLong(10),
    "name" : "Green Tea with Honey",
    "calss" : "BSC-SE",
    "createdAt" : new ISODate() })




Please let us know if you have any questions.


Regards,


Chris




On Monday, May 2, 2016 at 8:05:27 PM UTC+10, NileshM wrote:

issue not solved

PFA

On Mon, May 2, 2016 at 12:11 PM, Chris Cunningham <
chris.cunningham@xxxxxxxxxxx> wrote:

Nilesh,

Because Robomongo embeds the mongo shell, you should be able to add the
current date like the following example:

{
    "date" : ISODate("2016-05-26T00:00:00.000Z"),
    "userId" : NumberLong(10),
    "name" : "Green Tea with honey",
    "calss" : "BSC-SE",
    "createdAt" : new ISODate()
}



This works because the MongoDB shell is a JavaScript REPL, so you are
able to utilize JavaScript constructors to simplify tasks.

Additional information on new ISODate()can be found in the MongoDB
documentation at:

[Data Types in the mongo Shell
<https://docs.mongodb.org/manual/core/shell-types/#date>]

Please let us know if you have any further questions.

Regards,

Chris




On Wednesday, April 27, 2016 at 12:31:14 AM UTC+10, NileshM wrote:

i want to insert exact current date in mongoDB throw robo mongo.
PFA

--
You received this message because you are subscribed to the Google
Groups "mongodb-user"
group.

For other MongoDB technical support options, see:
https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/qDECOYroWRc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit
https://groups.google.com/d/msgid/mongodb-user/aaa5807d-f8fa-4ee8-9ae1-871d9abaf436%40googlegroups.com
<https://groups.google.com/d/msgid/mongodb-user/aaa5807d-f8fa-4ee8-9ae1-871d9abaf436%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.




--
Cheers,
Nilesh



--
You received this message because you are subscribed to the Google Groups
"mongodb-user"
group.

For other MongoDB technical support options, see:
https://docs.mongodb.org/manual/support/
---
You received this message because you are subscribed to a topic in the
Google Groups "mongodb-user" group.
To unsubscribe from this topic, visit
https://groups.google.com/d/topic/mongodb-user/qDECOYroWRc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit
https://groups.google.com/d/msgid/mongodb-user/91ac9c18-fcad-4788-92b7-37527ec78b12%40googlegroups.com
<https://groups.google.com/d/msgid/mongodb-user/91ac9c18-fcad-4788-92b7-37527ec78b12%40googlegroups.com?utm_medium=email&utm_source=footer>
.

For more options, visit https://groups.google.com/d/optout.




-- 
Cheers,
Nilesh

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/CAB0WCd9YTN%3Dg_nJ1k11RcoQCY4ayvd2recn9d%2Bk26XXT2eWv_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?