Learn, Share, Build

142
October 04, 2017, at 4:19 PM
db.checkins.aggregate
 ([{'$match':{"checkinData.time":
                    {"$gt":ISODate("2017-08-31T18:30:00.000Z"),
                    "$lte":ISODate("2017-08-31T20:00:00.000Z")}}},
  {"$project":{'dte': {"$dateToString": 
                             {format: "%Y-%m-%d", date:"$checkinData.time"}
                      }
              }}
])

Data return from Data Base it perfectly good it means all data return of next date (2017/09/01). but problem is that value of field 'dte' are showing previous date (2017-08-31)

Note- I have to show value of 'dte' is next date (2017-09-01).

I have used $dateToString and $subString

{"$project":{"dte":{"$substr":["$checkinData.time",0,10]},

it also same return 2017-08-31

Is there any method or query in mongoDB to show next date for this.

READ ALSO
Learn, Share, Build

Learn, Share, Build

Trying to print to my localhost a JSON array of all the managers but I'm greeted with a blank screenThe arrays are filled correctly, the problem is (most likely) occuring in the server

165
Learn, Share, Build

Learn, Share, Build

Searching for this error text I get only info about Google Chrome

177
Learn, Share, Build

Learn, Share, Build

I am new to mongodb and trying to save a user object to the mlab database and its stores a special character in the head and tail end of a stringI have added my sample data below

145
Learn, Share, Build

Learn, Share, Build

When using request, how do you set the request body? The form parameter creates a body of key value pairs: foo=bar&baz=qux, but how do you set the body to an arbitrary string?

154