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

Releasing updates to NPM? #6

Open
stieg opened this issue Oct 21, 2019 · 4 comments
Open

Releasing updates to NPM? #6

stieg opened this issue Oct 21, 2019 · 4 comments

Comments

@stieg
Copy link

stieg commented Oct 21, 2019

Hey Devs,

So was setting this up and hit issues. Eventually figured out that what is on NPM is extremely old (v0.0.1) vs what you have in the project here (v0.1.2). So I'm curious if you all plan to release this to NPM or not?

Also... off topic but is there any reason why this hasn't just been merged into the mongoose project. Seems important enough to warrant being in there but then again what do I know? TIA.

@vkarpov15
Copy link
Member

You're looking at the mongoose-double npm package, that one is out of date and should be deprecated. We publish updates to this repo as @mongoosejs/double: https://www.npmjs.com/package/@mongoosejs/double.

And in my experience this project isn't important enough to merge into mongoose core - it is very rare that as a JS developer it matters whether the db stores properties as integers or doubles, because they become numbers in JavaScript either way. What use cases are you using this project for?

@stieg
Copy link
Author

stieg commented Nov 11, 2019

You're looking at the mongoose-double npm package, that one is out of date and should be deprecated. We publish updates to this repo as @mongoosejs/double: https://www.npmjs.com/package/@mongoosejs/double.

I did eventually figure this out though it was a bit confusing since all the other packages follow this naming format and this one was here. Would be nice of the original maintainer to turn over control of that npm package name to you (since it is the same package anyways; just outdated).

And in my experience this project isn't important enough to merge into mongoose core - it is very rare that as a JS developer it matters whether the db stores properties as integers or doubles, because they become numbers in JavaScript either way.

While I agree with your assessment that this is a less common path for developers I would disagree that it does not belong in mongoose. Rationale being that because mongoose is the package that enables a developer to dictate the type to be stored in the DB, having just a generic number type on its own is insufficient because the user is unable to strongly dictate what type is actually being stored. A saner solution would be to prioritize strong types that map between javascript and the native BSON types. Then it makes sense at a secondary level to expose types like number that behave the way that they do because most developers don't really care. But that is the opinion of one developer; YMMV.

What use cases are you using this project for?

We use mongoose as the back-end to our API services primarily. Controlling the types in Mongo has become a priority for us because we map our MongoDB into a PostgreSQL DB for further data analysis. When the type in Mongo is variable then the mapping software starts renaming columns in the PostgreSQL DB to deal with the ambiguity, which in turn makes mapping and analysis much more difficult. As a workaround we have written a set of scripts that correct the data types in Mongo before the mapping software runs but this is an imperfect and temporary solution until we can use the mongoose-double package.

@vkarpov15
Copy link
Member

Thanks for the heads up, I deprecated mongoose-double on npm.

We may investigate an option to store JavaScript numbers consistently as doubles in MongoDB, your argument makes sense. The decision for the mongodb driver to store numbers as ints where possible long pre-dates my involvement with the project - if I were making that decision I would've made a different one, but it's hard to change a decision that's been baked in for almost a decade.

In email you mentioned you were using stitch. Can you take a look at purr? That's the in house ETL that my current employer built out for piping mongodb -> postgres. I haven't worked with it so I can't vouch for how easy it is to set up, but it works well for us. And it handles the int vs double distinction.

@vkarpov15
Copy link
Member

vkarpov15 commented Jan 17, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants