Document document = new Document("dateTime", "2019-03-01T01:11:52:44.089Z")
The value is stored as string datatype. How to store dare in mongodb?
Document document = new Document("dateTime", "2019-03-01T01:11:52:44.089Z")
The value is stored as string datatype. How to store dare in mongodb?
Maybe something like this:
def document = new com.mongodb.BasicDBObject("dateTime", new Date())
collection.insertOne(document)
More information: