We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
City Document : { "_id" : ObjectId("555ec317e6e8ce4e0d3c2541"), "state" : ObjectId("54f91ea29f2e20e67d61ba6c"), "deleted" : false, "created" : ISODate("2015-05-22T05:48:07.831Z"), "description" : "", "name" : "Hydrabad", "__v" : 0 }
State Document: { "_id" : ObjectId("54e461ef7214e6583c0c5ed5"), "__v" : 0, "created" : ISODate("2015-02-18T09:57:03.585Z"), "deleted" : false, "description" : "", "name" : "Andhra pradesh", "updated" : ISODate("2016-10-09T18:20:29.601Z") }
Schemas : StateSchema = new Schema({ _id: { type: String }, statename: { type: String, required: true, max: 50 }
})
CitySchema = new Schema({ id: mongoose.Schema.Types.ObjectId, name: { type: String, required: true, max: 50 },
statename: { type:String, ref: 'State' ,field: 'state'}, deleted: Boolean,
});
The text was updated successfully, but these errors were encountered:
@Ramakrishnatp see http://mongoosejs.com/docs/populate.html
Sorry, something went wrong.
No branches or pull requests
City Document :
{
"_id" : ObjectId("555ec317e6e8ce4e0d3c2541"),
"state" : ObjectId("54f91ea29f2e20e67d61ba6c"),
"deleted" : false,
"created" : ISODate("2015-05-22T05:48:07.831Z"),
"description" : "",
"name" : "Hydrabad",
"__v" : 0
}
State Document:
{
"_id" : ObjectId("54e461ef7214e6583c0c5ed5"),
"__v" : 0,
"created" : ISODate("2015-02-18T09:57:03.585Z"),
"deleted" : false,
"description" : "",
"name" : "Andhra pradesh",
"updated" : ISODate("2016-10-09T18:20:29.601Z")
}
Schemas :
StateSchema = new Schema({
_id: { type: String },
statename: { type: String, required: true, max: 50 }
})
CitySchema = new Schema({
id: mongoose.Schema.Types.ObjectId,
name: { type: String, required: true, max: 50 },
statename: { type:String, ref: 'State' ,field: 'state'},
deleted: Boolean,
});
The text was updated successfully, but these errors were encountered: