-
Notifications
You must be signed in to change notification settings - Fork 851
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
fix: query
option in gen2 sdks to correctly flatten the query object for mongodb
#3250
fix: query
option in gen2 sdks to correctly flatten the query object for mongodb
#3250
Conversation
🦋 Changeset detectedLatest commit: 2837f0d The changes in this PR will be included in the next version bump. This PR includes changesets to release 7 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
---|---|---|---|---|---|
314150 | Triggered | Generic High Entropy Secret | 7bb96a2 | packages/sdks/src/functions/get-content/snapshots/generate-content-url.test.ts.snap | View secret |
314150 | Triggered | Generic High Entropy Secret | 7bb96a2 | packages/sdks/src/functions/get-content/snapshots/generate-content-url.test.ts.snap | View secret |
314150 | Triggered | Generic High Entropy Secret | 7bb96a2 | packages/sdks/src/functions/get-content/snapshots/generate-content-url.test.ts.snap | View secret |
314150 | Triggered | Generic High Entropy Secret | 7bb96a2 | packages/sdks/src/functions/get-content/snapshots/generate-content-url.test.ts.snap | View secret |
314150 | Triggered | Generic High Entropy Secret | 7bb96a2 | packages/sdks/src/functions/get-content/snapshots/generate-content-url.test.ts.snap | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 2837f0d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 13 targets
Sent with 💌 from NxCloud. |
/** | ||
* Flatten a nested MongoDB query object into a flat object with dot-separated keys. | ||
* $ keys are not flattened and are left as is. | ||
*/ |
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.
Could you give some examples in the comment to explain the transformation
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.
+1
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.
sure! added, please let me know if we should add anything else
@samijaber I don't know if this is the right place for it, but after updating to the latest version of the SDK, my query (including $or: [
{
$and: [{ startDate: { $lte: Date.now() } }, { endDate: { $gte: Date.now() } }],
},
{
$and: [{ startDate: { $exists: false } }, { endDate: { $exists: false } }],
},
], |
Description
This PR updates the query option to use
flattenMongoQuery
which is basically flatten but when we get an$key
we just return the object as is as, so that it properly gets parsed in our API (mongo query).Jira
https://builder-io.atlassian.net/browse/ENG-5268
Loom
https://www.loom.com/share/10493e4fd2a24b40937590f7f690bff2
Fixes #3007