-
Notifications
You must be signed in to change notification settings - Fork 70
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
Providing custom _id for documents #154
Comments
Hi,
Can you please let us know:
1. How is your table defined on Mongo and
2. and the definition for it as a foreign table on PostgreSQL.
Regards,
Jeevan Ladhe
…On Thu, Dec 30, 2021 at 2:12 AM AdamPzpn ***@***.***> wrote:
Trying inserting data into foregin table ends with ignore for _id
parameter.
Example:
INSERT INTO warehouse VALUES (uuid_generate_v4()::text, 2, 'Laptop',
'2015-11-11T08:13:10Z');
Creates:
"_id" : ObjectId("53720b1904864dc1f5a571a0"),
"warehouse_id" : 2,
"warehouse_name" : "Laptop",
"warehouse_created" : ISODate("2015-11-11T08:13:10Z")
How can I insert literal _id as string into entity?
—
Reply to this email directly, view it on GitHub
<#154>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQKBZ4VRSU7RFUPRVGFXPADUTNXEXANCNFSM5K6SCK2A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
No problem. Ad.1
AD.2
|
Hi @AdamPzpn , Providing custom _id for a document not supported. Currently, mongo_fdw ignores the value of the first column which is the row identifier in MongoDb (_id) and lets MongoDB insert the unique value for that column. We will do more studies to try to support this feature in near future. |
I saw the last comment was from 1/2022. Is custom _id for a document supported now? |
Trying inserting data into foregin table ends with ignore for _id parameter.
Example:
INSERT INTO warehouse VALUES (uuid_generate_v4()::text, 2, 'Laptop', '2015-11-11T08:13:10Z');
Creates:
"_id" : ObjectId("53720b1904864dc1f5a571a0"),
"warehouse_id" : 2,
"warehouse_name" : "Laptop",
"warehouse_created" : ISODate("2015-11-11T08:13:10Z")
How can I insert literal _id as string into entity?
The text was updated successfully, but these errors were encountered: