fakemongo / fongo

faked out in-memory mongo for java
Apache License 2.0
523 stars 156 forks source link

Handle $dateToString projection #325

Open TehBakker opened 6 years ago

TehBakker commented 6 years ago

Greetings,

Using Fongo for my integration test for the DB layer and it works GREAT!

However I'm testing aggregation method, doing date transformation and the projection doesn't work like on real mongo DB. I'm using Spring Mongo JPA criteria project().andExpression("dateToString('%Y-%m-%d', 'myMongoField')").as("creationDate"));

Fongo returns : { "$dateToString" : { "date" : { "$date" : "2018-02-11T19:02:59.697Z"}}} Mongo returns : 2018-02-11

homiodev commented 6 years ago

Same issue

ptitcoutu commented 5 years ago

I've got exactly the same issue