parse-community / parse-community/parse-server
saveAll should use Mongo's insertMany method for bulk saving new documents
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 21.4k
- Forks
- 4.8k
- Avg merge
- 7h 45m
- Merged PRs (30d)
- 11
Description
New Feature / Enhancement Checklist
Current Limitation
Unless I'm misreading the code, it appears that under the hood the Parse.Object.saveAll method is making many synchronous requests instead of batching them together into a single atomic Bulk request. I see in the MongoStorageAdapter that Parse uses updateMany and even deleteMany, but I don't see insertMany anywhere and the only create function appears to be createObject (singular). The batch endpoint handler also appears to be running the requests separately (here). Please let me know if I'm missing something that we are actually inserting documents in bulk!
Feature / Enhancement Description
By leveraging Mongo's native insert bulk function, we'd reduce number of connections and speed up large requests.
Example Use Case
I need to insert 1000 new documents but want the inserts to happen as close to simultaneously as possible.
Alternatives / Workarounds
Using the Mongo driver directly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading MongoStorageAdapter and the batch endpoint handler in src/batch.js, especially the createObject path and how Parse.Object.saveAll requests are processed. Compare the existing updateMany and deleteMany usage with new-document handling, then verify that large saveAll calls use Mongo's bulk insertion behavior and preserve the expected request semantics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb, node.js
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100