Skip to content

Instantly share code, notes, and snippets.

@aheckmann
Created June 20, 2012 20:03
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aheckmann/2961869 to your computer and use it in GitHub Desktop.
Save aheckmann/2961869 to your computer and use it in GitHub Desktop.
v3-comment-schema
var commentSchema = new Schema({
body: String
, user: Schema.ObjectId
, created: { type: Date, default: Date.now }
});
var postSchema = new Schema({ comments: [commentSchema] });
var Post = mongoose.model('Post', postSchema);
@eduard-tkv
Copy link

sdfasdf

@borellaster
Copy link

How can I set de GMT property for default date?

@farzadso
Copy link

farzadso commented Sep 20, 2018

How can I set de GMT property for default date?

If you're using mongo in a node.js app, you can use moment to create such functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment