Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Insert a new line at the right place in an array of dictionary in a MongoDB document in one operation #30

Open
AlexandreDewilde opened this issue Nov 26, 2020 · 0 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@AlexandreDewilde
Copy link
Member

AlexandreDewilde commented Nov 26, 2020

async newLine (documentLink, previousUuid, uuid, content) {

Here is a document :
{_id:..., ..., content: [{uuid:'...' , content}, ......]}
The method newLine add a new dictionary with parameters specified at the right index in content knowing the uuid of the element that precede it
Right now newLine query the index of the previous line and then insert it after the index found.
The goal is to find a way to do this in one operation, and then rewrite applyRequests with bulk write.
So my question is it possible?

@AlexandreDewilde AlexandreDewilde added help wanted Extra attention is needed question Further information is requested labels Nov 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant