-
Notifications
You must be signed in to change notification settings - Fork 595
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
How can I create a partial key where the parent uses an ID identifier in Datastore #567
Comments
var key = dataset.key(['Entry', 1234, 'ChildEntryKind']); should do what you want, right? |
I was looking for an automatically generated numeric ID. The same way the key will produce something like 5657382461898752 for the ChildEntryKind. I don't want to stick in 1234 for every parent Entry. |
If you want an auto-generated ID for the parent, you would have to save it first, and then use that auto-generated ID. There is currently no way to create both a parent and a child in a single request where both have auto-generated IDs. That is, you can't make a single request to do the equivalent of this: var key = dataset.key(['ParentKind', <auto-generated-id>, 'ChildEntityKind']); You can, however, create a child with a non-existent parent, if you choose the name of the parent. That is, if you create the following key, you'll create an entity of Kind var key = dataset.key(['ParentKind', 'parent-entity-key', 'ChildEntityKind']); |
I don't believe there's anything else our library can do, since we're limited by:
@jgeewax is it worth keeping this issue open to track when that feature launches, or is it not something that's being worked on? |
Technically, there a few options here:
Keep in mind that the child can exist without the parent -- so the key @stephenplusplus: Do we support allocating IDs at all using gcloud-node? |
I think we've gone over all of the options here, and we currently support solutions 1-3 mentioned above. Please re-open if there's more we can do. |
* feat!: Update library to use Node 12 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release \*beep\* \*boop\* --- ### [3.3.4](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.3...v3.3.4) (2021-06-22) ### Bug Fixes * make request optional in all cases ([#566](https://www.github.com/googleapis/nodejs-video-intelligence/issues/566)) ([ef7abca](https://www.github.com/googleapis/nodejs-video-intelligence/commit/ef7abca3d3d7ba44f0fc8406ebef4a5396147bc4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
* chore(main): release 3.1.3 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
* chore(main): release 3.1.3 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
🤖 I have created a release \*beep\* \*boop\* --- ### [3.3.4](https://www.github.com/googleapis/nodejs-video-intelligence/compare/v3.3.3...v3.3.4) (2021-06-22) ### Bug Fixes * make request optional in all cases ([#566](https://www.github.com/googleapis/nodejs-video-intelligence/issues/566)) ([ef7abca](https://www.github.com/googleapis/nodejs-video-intelligence/commit/ef7abca3d3d7ba44f0fc8406ebef4a5396147bc4)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- ## [3.0.0](googleapis/nodejs-iot@v2.5.1...v3.0.0) (2022-06-20) ### ⚠ BREAKING CHANGES * update library to use Node 12 (#566) ### Features * AuditConfig for IAM v1 ([#552](googleapis/nodejs-iot#552)) ([1b1a3d2](googleapis/nodejs-iot@1b1a3d2)) ### Bug Fixes * **deps:** update dependency @google-cloud/pubsub to v3 ([#569](googleapis/nodejs-iot#569)) ([77a2005](googleapis/nodejs-iot@77a2005)) * **deps:** update dependency @google-cloud/storage to v6 ([#568](googleapis/nodejs-iot#568)) ([b15efb4](googleapis/nodejs-iot@b15efb4)) ### Build System * update library to use Node 12 ([#566](googleapis/nodejs-iot#566)) ([1efe654](googleapis/nodejs-iot@1efe654)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
* chore(main): release 3.1.0 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: sofisl <[email protected]>
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/9610e861-65a2-4035-85ab-1303620c4597/targets - [ ] To automatically regenerate this PR, check this box. Source-Link: googleapis/synthtool@363fe30
I know to create a partial key I can write
how can I write a partial key with a parent without specifying name ? For example
creates a partial key with a parent, but the parent key has an identifier name='foot'. How can I state that the parent should use a numeric id (or am I misunderstanding this) ?
The text was updated successfully, but these errors were encountered: