Add Mongoose + Document DB Playground#1
Merged
hossain-rayhan merged 2 commits intoJul 24, 2026
Conversation
hossain-rayhan
force-pushed
the
rayhan/mongoose-playground
branch
from
July 23, 2026 21:40
3b07f39 to
ec28e3e
Compare
alaye-ms
approved these changes
Jul 24, 2026
patty-chow
reviewed
Jul 24, 2026
| | Unique indexes | ✅ Supported | Duplicate keys raise the standard `E11000` error. | | ||
| | Aggregation pipelines | ✅ Common stages | `$match`, `$group`, `$unwind`, `$sort`, etc. Atlas-only stages differ.| | ||
| | `findById` / `_id` lookups | ✅ Supported | Works on the current `documentdb-local:latest` image. | | ||
| | `$vectorSearch` | ❌ Not supported | Atlas-only operator; not implemented by DocumentDB. | |
There was a problem hiding this comment.
Current DocumentDB implements native $vectorSearch
Collaborator
Author
There was a problem hiding this comment.
Thanks. Added new tests for vecotrSearch and updated README.
patty-chow
approved these changes
Jul 24, 2026
Signed-off-by: Rayhan Hossain <hossain.rayhan@outlook.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Mongoose + DocumentDB playground
First playground for
documentdb-playground: a quick, hands-on guide for testing DocumentDB with Mongoose, the most popular MongoDB ODM for Node.js. Everything runs locally against a DocumentDB container in Docker — no Kubernetes, no cloud, no image builds.What's included
playgrounds/mongoose/app/) —/booksCRUD,/health, and a/stats/genresaggregation endpoint.app/mongoose-crud-test.js) — exercises connect, schema/index creation, insert, query, update, aggregation, unique-index enforcement, and delete, printing a pass/fail summary.scripts/):run-test.sh— start DocumentDB (if needed) and run the compatibility suite end-to-end (agent/CI-friendly).run-app.sh— start DocumentDB (if needed) and serve the demo API on:3000.start-documentdb.sh/stop-documentdb.sh— manage the localdocumentdb-localcontainer.lib.sh— shared container lifecycle, readiness wait, and connection-string builder.How DocumentDB runs locally
Uses the official image, bound to loopback:
Notes / design decisions
127.0.0.1— keeps the DB off external interfaces and works around a Docker Desktop/WSL2 quirk where the IPv4 loopback mapping was otherwise unreachable.docdbadmin(the gateway rejects the reserved namedocumentdb).directConnection: true,tls: true,tlsAllowInvalidCertificates: true, and stripsreplicaSet=rs0automatically.run-app.shandrun-test.share independent and can run concurrently (app uses DBmongoose_demo, tests usemongoose_test) — no port-forward to clobber.Testing
Verified end-to-end against
documentdb-local:latest:findById_id"pruned relation" bug is resolved in the current image)./health, POST/GET/books, and/stats/genresall working.