Git Product home page Git Product logo

greenleafoss / green-leaf-mongo Goto Github PK

View Code? Open in Web Editor NEW
18.0 2.0 3.0 198 KB

๐ŸŒฑ This extension created on top of official MongoDB Scala Driver and allows to fully utilize Spray JSON, Play JSON or Circe JSON to represent bidirectional serialization for case classes in BSON, as well as flexible DSL for MongoDB query operators, documents and collections.

Home Page: https://greenleafoss.github.io/green-leaf-mongo/

License: Apache License 2.0

Scala 100.00%
scala spray-json mongodb json bson mongo-scala-driver query-dsl mongo-java-driver mongodb-driver play-json

green-leaf-mongo's People

Contributors

lashchenko avatar michealzub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

green-leaf-mongo's Issues

Java 9 now() returns result with microsecond precision

OracleJdk8 is no longer available in Travis builds so I've updated the build config to use OpenJdk11 dba73b7

However, since Java 9 now() returns result with microsecond precision but GreenLeafBsonProtocol.ZdtFormat read() and write() methods use Instant.toEpochMilli and Instant.ofEpochMilli.

This is issue for our tests because deserialized entity is not the same as the entity:

Some(ExchangeRate(ExchangeRateId(USD,2019-01-02T00:00Z),Map(USD -> 1.0, EUR -> 0.8774238835, GBP -> 0.7911292445, CAD -> 1.3641309116, PLN -> 3.769763973, JPY -> 109.0462402387),2020-10-28T07:14:36.804Z)) 

was not equal to 

Some(ExchangeRate(ExchangeRateId(USD,2019-01-02T00:00Z),Map(USD -> 1.0, EUR -> 0.8774238835, GBP -> 0.7911292445, CAD -> 1.3641309116, PLN -> 3.769763973, JPY -> 109.0462402387),2020-10-28T07:14:36.804821Z))

Make possible to pass truncate parameter in ZDT.now()

Since Java 9 now() returns result with microsecond precision #2 . Changes in #3 defines ZDT.now() with hardcoded truncatedTo(MILLIS):

def now: ZonedDateTime = ZonedDateTime.now(ZoneOffset.UTC).truncatedTo(ChronoUnit.MILLIS)

In may be better to have additional flexibility and make possible pass TemporalUnit argument into truncatedTo function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.