Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing Driver Helpers #103

Open
Kaffiend opened this issue Oct 5, 2017 · 4 comments
Open

Accessing Driver Helpers #103

Kaffiend opened this issue Oct 5, 2017 · 4 comments
Labels
awaiting release This is not yet part of a stable release (master) enhancement This will add functionality to the Public API of the library and will result in a minor release question This issue is a question about the usage or behaviour of the library
Milestone

Comments

@Kaffiend
Copy link

Kaffiend commented Oct 5, 2017

What is the recommended way to access and utilize helpers such as NumberDecimal for monetary fields? But more importantly will the V8 branch update to mongo 3.4 peer dependency to have such helpers new in that version?

@notheotherben
Copy link
Member

Hi Ian,

I haven't yet looked into the helpers, however I will do so and get back to you (with the client library update as well). I suspect the easiest solution will be using a transform, but let me confirm.

@Kaffiend
Copy link
Author

Kaffiend commented Oct 5, 2017

Benjamin,
I may have misread documentation, the example i gave is for the shell. It appears the best way is still Exact Precision for monetary values.

@notheotherben
Copy link
Member

I've just gone through the process of updating the client libraries and exposing some additional helper methods in the form of toDecimal128 and toLong which should enable you to more easily make use of the underlying BSON datatypes (as one would with ObjectID) for these kinds of things.

This is all published and available in 8.0.0-alpha.5 if you'd like to try it out, however as you mentioned, there are a number of solutions which work well to avoid the need for them in the first place.

Regards,
Benjamin

@Kaffiend
Copy link
Author

I will give it a shot, Thank you Benjamin.

@notheotherben notheotherben added enhancement This will add functionality to the Public API of the library and will result in a minor release question This issue is a question about the usage or behaviour of the library awaiting release This is not yet part of a stable release (master) labels Mar 30, 2018
@notheotherben notheotherben added this to the Version 8 milestone Mar 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting release This is not yet part of a stable release (master) enhancement This will add functionality to the Public API of the library and will result in a minor release question This issue is a question about the usage or behaviour of the library
Projects
None yet
Development

No branches or pull requests

2 participants