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

Include bson library and use its BinaryParser #21

Closed
wants to merge 4 commits into from
Closed

Include bson library and use its BinaryParser #21

wants to merge 4 commits into from

Conversation

w33ble
Copy link

@w33ble w33ble commented Apr 19, 2012

The mongo package no longer seems to include bson's BinaryParser, so the reference doesn't work anymore. Instead of relying on mongo, I thought it appropriate to include bson in this module instead.

Related to pull request #17, just a different way to fix the problem

@kof
Copy link

kof commented May 3, 2012

you need either include bson in dependencies of package.json or use a full path to bson in mongoose/node_modules/mongodb/node_modules/bson/lib

@w33ble
Copy link
Author

w33ble commented May 3, 2012

Yup, did that in fb0de2f. In 3faca48, I removed the conditional createdAt stuff, so it's always written to the record instead of parsing the _id, and then later realized it no longer needed the BinaryParser at all, so 1078b9a was created

@yzapuchlak
Copy link

Could this be pull request be accepted and a new version pushed of the module pushed to NPM (or one of the other pull requests that resolves the BinaryParser issue)? Thanks! : )

@w33ble
Copy link
Author

w33ble commented Jun 1, 2012

The author seems to have a ton of other things going on, including several other highly-used modules, so it's probably going to be a while before this gets fixed :(. In the meantime, you can fork and fix, or use one of the pull requests in your package.json. For example, this works:
"dependencies": {
"mongoose-types": "git://github.com/w33ble/mongoose-types.git#bson-patch"
}
In this case of the latest commit on this branch, createdAt is always written to the document, so it doesn't rely on the BsonParser to extrapolate it from the record's _id. If you want the original functionality, fb0de2f will include the bson package as a dependency of mongoose-types and use that package specifically.

@yzapuchlak
Copy link

Wow, I didn't know you could list a git repo as a dependency -- that's
awesome!

What I had been doing as a temporary solution was to clone that pull
request and check it into my project repo, but the git repo dependency
solution is much more elegant and I've already switched over to it.

Thanks very much for the info! : )

@w33ble
Copy link
Author

w33ble commented Jun 4, 2012

You're quite welcome. It's a handy little trick.

I believe you can add a specific commit to the path too, but I have yet to have that work correctly. IIRC, the syntax is git://path.to.repo#branch@sha, or something like git://github.com/w33ble/mongoose-types.git#bson-patch@fb0de2f.

And of course, if this is something you're relying on, it's probably best to fork and reference your own repo. That way you have complete control over changes. Handy in case I push a change that breaks your code ;)

@fizerkhan
Copy link

Is there any updates?

Is Mongoose-types active now?

@ghost
Copy link

ghost commented Mar 19, 2013

Seems like this repo is inactive. You may find some forks that are still active or take a look at https://github.com/tblobaum/mongoose-troop#timestamp

@w33ble
Copy link
Author

w33ble commented Mar 19, 2013

Thanks @jackdbernier, that module looks pretty nice!

@w33ble w33ble closed this Dec 1, 2016
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

Successfully merging this pull request may close these issues.

4 participants