-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fix(db-mongodb): improve compatability with Firestore database #12763
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
Open
elliott-w
wants to merge
59
commits into
payloadcms:main
Choose a base branch
from
elliott-w:firestore
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
59 commits
Select commit
Hold shift + click to select a range
e685d43
Add manual join option to Mongo adapter
elliott-w 3332aa9
Disable memory server if DATABASE_URI set
elliott-w 5655216
Prevent createIndex and dropDatabase operations if PAYLOAD_MANUAL_JOI…
elliott-w b452ddc
Add support for PAYLOAD_DATABASE to be 'firestore'
elliott-w 5b64c40
Fix dropDatabase monkey patch
elliott-w 1060438
Fix customIDType 'number'
elliott-w b02796a
More work
elliott-w 6400b5b
Fix buildSortParam
elliott-w f29e1be
Fix buildSortParam
elliott-w c76c961
Delete manual joins folder
elliott-w 6eb5e9f
Polymorphic joins
elliott-w 04c2cd5
better polymorphic joins
elliott-w 32834cf
More progress
elliott-w 95a466a
Fix queryDrafts
elliott-w 575b11d
remove __resolveJoins flag
elliott-w b10d3d7
Revert resolveJoins
elliott-w c9aaf88
Fix returning 0 documents rather than all when limit is 0
elliott-w 1baaada
Fix queryDrafts
elliott-w 8123768
Use similar versions/drafts detection to buildJoinAggregation
elliott-w fbb13ea
Fix test "should join across multiple collections"
elliott-w 5c5075b
Sinplify polymorphic joins
elliott-w bc28e5f
Fix test "should not throw a path validation error when querying join…
elliott-w a96a6ea
Fix type and lint issues
elliott-w 54dfcf5
Fix failing test "should rollback operations on failure"
elliott-w 2141268
Remove transactions
elliott-w a2b867c
Optimize resolveJoins performance
elliott-w 60efea6
Update mongodb documentation
elliott-w 6b33e2d
Fix mongoose adapter args
elliott-w 2797699
Revert files to main
elliott-w e5acc57
Re-order firestore adapter
elliott-w 2308ffd
Rename `manualJoins` -> `useJoinAggregations`
elliott-w 22c1145
Move utility functions to bottom of file
elliott-w f315e80
Improve resolveJoins type comments
elliott-w 25cc5aa
Fix transform not being applied for version documents
elliott-w a8775ad
Fix polymorphic collection join test expectation
elliott-w ec5be8c
Add commonTitle field to polymorphic test collections
elliott-w ecf8987
Step
elliott-w 5d911f0
Fix typescript and lint errors
elliott-w c2f97cb
Fix test 'should join across multiple collections'
elliott-w 3142336
Add ability to sort by multiple properties
elliott-w 47fa002
Add projections
elliott-w bdb2a3a
Extract buildJoinProjection
elliott-w 92f9f3a
Simplify by treating all joins as polymorphic
elliott-w d53a384
Revert joins int.spec.ts
elliott-w 66f207b
Fix bugs
elliott-w de8954b
Apply limit and page client-side
elliott-w 8707bd5
Fix joinPath on arrays
elliott-w e4de5dc
Fix polymorphic relationship fields
elliott-w 3e6096f
Fix versions
elliott-w 5c505cf
Add compatabilityOptions utility and remove compatabilityMode arg
elliott-w 7982056
Revert "Add commonTitle field to polymorphic test collections"
elliott-w 042c349
Fix lint errors resolveJoins
elliott-w ce6dac1
Improve generateDatabaseAdapter firestore settings
elliott-w 7275656
Add firestore to database testing matrix
elliott-w 8c27e55
Tidy up comments
elliott-w f27525e
Update documentation
elliott-w 90d34c9
Apply sort and pagination at the database level for non-polymorphic j…
elliott-w d5b6802
Fix int-firestore job
elliott-w 132461b
Use normal dropDatabase for testing
elliott-w File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,6 +169,7 @@ jobs: | |
matrix: | ||
database: | ||
- mongodb | ||
- firestore | ||
- postgres | ||
- postgres-custom-schema | ||
- postgres-uuid | ||
|
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this also drop existing indexes and collections themselves outside of just deleting all the documents?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@r1tsuu ideally yes, but firestore doesn't support managing (CRUD) indexes through the Mongo API (Wire Protocol). It also doesn't support the dropCollection command. It all has to be done through the Google Cloud Console or CLI.
I don't think this is that big of an issue though, because the only time payload ever drops a database is during testing and it's fine to pollute a test db with empty collections.