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

If createdAt or updatedAt is already present, ignore adding it #31

Open
luckydev opened this issue Sep 8, 2015 · 0 comments
Open

If createdAt or updatedAt is already present, ignore adding it #31

luckydev opened this issue Sep 8, 2015 · 0 comments

Comments

@luckydev
Copy link

luckydev commented Sep 8, 2015

If a schema already has createdAt field, dont add it. Instead, add updatedAt field alone and maintain it. Vice versa for the updatedAt field.

Right now in version 0.3.0, this is the error I get when createdAt is already there and if I use mongoose-timestamp in that schema.

/Users/Anand/xyz/node_modules/mongoose-timestamp/index.js:34
      .get( function () {
       ^
TypeError: Object #<Object> has no method 'get'
    at timestampsPlugin (/Users/Anand/xyz/node_modules/mongoose-timestamp/index.js:34:8)
    at Schema.plugin (/Users/Anand/xyz/node_modules/mongoose/lib/schema.js:570:3)
    at Object.<anonymous> (/Users/Anand/xyz/models/session_token.js:12:20)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/Anand/xyz/models/agent.js:17:20)
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

1 participant