Skip to content
New issue

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

does fle work with insertMany or create #78

Closed
mergingseas opened this issue Sep 14, 2022 · 5 comments
Closed

does fle work with insertMany or create #78

mergingseas opened this issue Sep 14, 2022 · 5 comments

Comments

@mergingseas
Copy link

Hello,
Looks like there isn’t support for insertMany or create mongoose queries ?

@wheresvic wheresvic self-assigned this Jan 30, 2023
@wheresvic
Copy link
Owner

Hi,

Yes this is a new feature and I will make a ticket for it. Would you like to help implement it?

@DilipCoder
Copy link

Hi,
i would like to implement support for mongoose create method.
can you please guide me.

@adidaslevy
Copy link
Contributor

Hello!
Actually, I'm also interested with encryption of bulk operations.

I tried to run encryptFieldsSync in 'pre' hook of 'insertMany', but the document is still the model, and not actual document that going to DB.

Anyway, because of only 'encrypt' method is exposed, it's the only thing I can use - I would prefer to run the encryptFields method, that does all for me.

Also, I have created a wrapper plugin where it allows user to only state the fields he want to encrypt in schema itself in the form:

export const MongoEncryptionSchema: Schema = new Schema({ firstName: { type: String, required: true, encrypt: true }, middleName: { type: String, required: true, encrypt: true }, lastName: { type: String, required: true, encrypt: true }, phoneNumber: { type: String, required: true, encrypt: true }, email: { type: String, required: true, encrypt: true } ....

@adidaslevy
Copy link
Contributor

I think I'm going to contribute a pre hook for insertMany..

@wheresvic
Copy link
Owner

Fixed via #94

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants