Merge pull request #7593 from jhasselkus/mongoose-fix-7499

mongoose.d.ts Document interface should define _id as any
This commit is contained in:
Horiuchi_H
2016-01-13 11:45:28 +09:00
2 changed files with 11 additions and 1 deletions
+10
View File
@@ -41,6 +41,16 @@ var schema: mongoose.Schema = new Schema({ name: String }, { collection: 'actor'
schema.set('collection', 'actor');
var Model = mongoose.model<IActor>('Actor', schema, 'actor');
interface IZip extends mongoose.Document {
_id: string;
}
interface IPerson extends mongoose.Document {
_id: mongoose.Types.ObjectId;
}
interface IThing extends mongoose.Document {
_id: number;
}
var names: string[] = mongoose.modelNames();
var names: string[] = db.modelNames();
mongoose.plugin((schema: mongoose.Schema) => {
+1 -1
View File
@@ -423,7 +423,7 @@ declare module "mongoose" {
export interface Document {
id?: string;
_id: Types.ObjectId;
_id: any;
equals(doc: Document): boolean;
get(path: string, type?: new(...args: any[]) => any): any;