mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #11589 from simonxca/patch-mongoose
Mongoose: set document id property to be optional
This commit is contained in:
Vendored
+6
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user