Replies: 3 comments 1 reply
-
Sure. The Apostrophe API tries to reduce the overhead of making requests to the database, but updateMany is a valid MongoDB method. You can read about direct DB access here: https://v3.docs.apostrophecms.org/guide/database-access.html#working-with-collections |
Beta Was this translation helpful? Give feedback.
0 replies
-
Just to build on what Bob said here, direct MongoDB access can be your
friend in this situation. Just take care to consider aposLocale and the
question of permissions (should this user even be allowed to manipulate
these documents). Which may or may not be a concern depending on your
project.
One way to address permissions is to do .find(req, { ...
}).permission('edit').toArray() when fetching the documents in the first
place, which will only return documents the user is permitted to edit. Then
you have a set of document ids you know it is OK to pass to updateMany.
…On Wed, Feb 15, 2023 at 5:31 AM Robert Means ***@***.***> wrote:
Sure. The Apostrophe API tries to reduce the overhead of making requests
to the database, but updateMany is a valid MongoDB method. You can read
about direct DB access here:
https://v3.docs.apostrophecms.org/guide/database-access.html#working-with-collections
—
Reply to this email directly, view it on GitHub
<#4046 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAH27NBLR7N6T6SFL6X6HTWXSWA3ANCNFSM6AAAAAAU4OYDSQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: <apostrophecms/apostrophe/repo-discussions/4046/comments/4981807@
github.com>
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Beta Was this translation helpful? Give feedback.
1 reply
-
Perhaps you’d better share your use case in more detail.
On Wed, Feb 15, 2023 at 5:39 PM Tshitshi Kia Ntoni ***@***.***> wrote:
Thank you Tom and Bob.
OK. But What about relationship and relationshipReverse fields ?
—
Reply to this email directly, view it on GitHub
<#4046 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAH27IK2SUOTLCPDVLPEATWXVLJHANCNFSM6AAAAAAU4OYDSQ>
.
You are receiving this because you commented.Message ID:
***@***.***
com>
--
THOMAS BOUTELL | CHIEF TECHNOLOGY OFFICER
APOSTROPHECMS | apostrophecms.com | he/him/his
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Is there a way to do
... self.updateMany ...
Best regards,
Tshitshi
Beta Was this translation helpful? Give feedback.
All reactions