diff --git a/docs/guide.jade b/docs/guide.jade index d3de6564737..d38d10dd468 100644 --- a/docs/guide.jade +++ b/docs/guide.jade @@ -577,7 +577,12 @@ block content h4#versionKey option: versionKey :markdown - The `versionKey` is a property set on each document when first created by Mongoose. This keys value contains the internal [revision](http://aaronheckmann.tumblr.com/post/48943525537/mongoose-v3-part-1-versioning) of the document. The name of this document property is configurable. The default is `__v`. If this conflicts with your application you can configure as such: + The `versionKey` is a property set on each document when first created by + Mongoose. This keys value contains the internal + [revision](http://aaronheckmann.tumblr.com/post/48943525537/mongoose-v3-part-1-versioning) + of the document. The `versionKey` option is a string that represents the + path to use for versioning. The default is `__v`. If this conflicts with + your application you can configure as such: :js var schema = new Schema({ name: 'string' }); var Thing = mongoose.model('Thing', schema); @@ -591,7 +596,9 @@ block content thing.save(); // { _somethingElse: 0, name: 'mongoose v3' } :markdown - Document versioning can also be disabled by setting the `versionKey` to false. _DO NOT disable versioning unless you [know what you are doing](http://aaronheckmann.tumblr.com/post/48943525537/mongoose-v3-part-1-versioning)._ + Document versioning can also be disabled by setting the `versionKey` to + `false`. + _DO NOT disable versioning unless you [know what you are doing](http://aaronheckmann.tumblr.com/post/48943525537/mongoose-v3-part-1-versioning)._ :js new Schema({..}, { versionKey: false }); var Thing = mongoose.model('Thing', schema); diff --git a/lib/schema.js b/lib/schema.js index ffed15c1a9e..a6bd8b38ece 100644 --- a/lib/schema.js +++ b/lib/schema.js @@ -49,7 +49,7 @@ var IS_QUERY_HOOK = { * - [toObject](/docs/guide.html#toObject) - object - no default * - [typeKey](/docs/guide.html#typeKey) - string - defaults to 'type' * - [validateBeforeSave](/docs/guide.html#validateBeforeSave) - bool - defaults to `true` - * - [versionKey](/docs/guide.html#versionKey): bool - defaults to "__v" + * - [versionKey](/docs/guide.html#versionKey): string - defaults to "__v" * * ####Note: *