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

Can't access createdAt with Mongoose 2.3.2 #9

Open
alfrednerstu opened this issue Oct 17, 2011 · 3 comments
Open

Can't access createdAt with Mongoose 2.3.2 #9

alfrednerstu opened this issue Oct 17, 2011 · 3 comments

Comments

@alfrednerstu
Copy link

I can't access createdAt. I can access and also see updatedAt when querying and looking at the collection
(I guess that createdAt uses the date in ObjectId and that's why I don't see it toghether with updatedAt in my collection?).

These are the packages I use:
[email protected]
[email protected]
[email protected]

@drauschenbach
Copy link

+1

@leesolutions
Copy link

I had the same issue. I removed the if block in the plugin code to make this work. Can anyone shed light on why the plugin checks for the existence of _id path?

https://gist.github.com/1330798

@jspears
Copy link

jspears commented Apr 10, 2012

The problem is with mongodb not exporting BinaryParser any more. You need to change the import in useTimestamps to something like this.

file ./lib/plugins/useTimestamps.js

var mongoose = require('mongoose')
, ObjectID = mongoose.ObjectID
, BinaryParser = require('mongoose/node_modules/mongodb/node_modules/bson').BinaryParser;

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

4 participants