Closed zzzet closed 9 years ago
Hi @tezlopchan
Please confirm that this test case covers the issue.
I'm creating a company and a user. Then I associate the two. After saving I retrieve the user and populates. The company is there as it should.
But perhaps I've misunderstood the problem. Can I see your Schema definitions and how you associate the two documents?
Well i have the CompanySchema and UserSchema as below:
var CompanySchema = new Schema({
name: { type: String, trim: true, require: true, unique: true },
status: { type: Boolean, Default: false},
code: { type: String, min: 3, max: 3, unique: true }
})
var UserSchema = new Schema({
username: { type: String, trim: true, require: true, unique: true},
name: {
first: { type: String, trim: true, require: true},
last: { type: String, trim: true, require: true}
},
scope: {type: String, enum: ['superadmin', 'admin', 'employee']},
company: {
type: Schema.ObjectId,
ref: 'Company'
},
isVerified: { type: Boolean, default: false }
});
That seems identical to the test cases I created. Can you try to test the latest version: 5.1 — I updated dependencies, they were about old.
Thank you I will test it right now
Its working.. thanks for the update :+1: :+1:
Hi Michael, I was using this plugin and while trying to use populate, i get no data of that field and if i disable the plugin i get the data from another collections too with populate
and while i enable the plugin:
and my query looks like