Closed rubencosta13 closed 1 year ago
@wheresvic Any updates here?
Also my populates arent working...
here's a sample of my model:
const userModel = new mongoose.Schema({
user: {
type: String,
required: true
},
userAttributes: [
{
type: mongoose.Schema.Types.ObjectId,
ref: 'UserAttributes',
},
],
});
const userAttributes = new mongoose.Schema({
name: {
type: String,
required: true
},
attributes: [
{
type: mongoose.Schema.Types.ObjectId,
ref: 'UserAttributes',
},
],
status: {
type: Boolean,
required: true
}
});
const attributes = new Attributes({
name: 'Developer',
attributes: [
'Developer',
'SWE',
'some random entry'
],
status: true
});
const user = new User({
user: "John",
attributes: attributes._id
});
attributes.save();
user.save();
if I try to populate the attributes on the user, it just returns me null, on the whole query
Hi @rubencosta13 , I'm facing same issue. Did you solve it ?
Greetings!
I'm using mongoose-field-encryption to encrypt specific fields on a model... However, I need to find data with a mongoose operator:
$in:
Which refuses to work with mongoose-field-encryption!Here are the code snippets I'm using:
Create the users:
My goal is to find all the users that have the attribute "Developer", which, without mongoose-field-encryption can be done as follows:
Source: Docs
However if I try to run the same query, on a model that has mongoose-field-encryption, it will return all the documents, even though only the user "Maria" has the developer attribute...
Is there any way to fix this?