Merge pull request #11589 from simonxca/patch-mongoose

Mongoose: set document id property to be optional
This commit is contained in:
Horiuchi_H
2016-09-30 12:31:31 +09:00
committed by GitHub
+6 -3
View File
@@ -715,7 +715,7 @@ declare module "mongoose" {
* section document.js
* http://mongoosejs.com/docs/api.html#document-js
*/
class MongooseDocument {
class MongooseDocument implements MongooseDocumentOptionals {
/** Checks if a path is set to its default. */
$isDefault(path?: string): boolean;
@@ -870,8 +870,6 @@ declare module "mongoose" {
/** Hash containing current validation errors. */
errors: Object;
/** The string version of this documents _id. */
id: string;
/** This documents _id. */
_id: any;
/** Boolean flag specifying if the document is new. */
@@ -880,6 +878,11 @@ declare module "mongoose" {
schema: Schema;
}
interface MongooseDocumentOptionals {
/** The string version of this documents _id. */
id?: string;
}
interface DocumentToObjectOptions {
/** apply all getters (path and virtual getters) */
getters?: boolean;