Skip to content
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

mapping cosmos-nosql id to mongodb _id #104

Open
Snamnik opened this issue Jan 11, 2024 · 1 comment
Open

mapping cosmos-nosql id to mongodb _id #104

Snamnik opened this issue Jan 11, 2024 · 1 comment

Comments

@Snamnik
Copy link

Snamnik commented Jan 11, 2024

I'm going to migrate my data from cosmos-nosql to mongodb .
the tool doesn't map the cosmos id field to mongodb _id field.
for example:
cosmos data:

 {  "id": "BSKT_1",
    "CustomerId": 111,
}

the mapped data in mongo

{
"_id": ObjectId("659f9bbcb128ee4f195bdf8d"),
"id" : "BSKT_1",
"CustomerId": 111
}

how can I resolve this issue?

@Snamnik
Copy link
Author

Snamnik commented Jan 11, 2024

have found the issue.
it's due to a section of the code in MongoDataSinkExtension Class, BuildDynamicObjectTree() where 'id' will be added rather than '_id' for MongoDB sink.

I see BuildDynamicObjectTree() is a general behavior which has been using in many places of the repo. but can we handle this issue for MongoDB as a configuration, just before adding the object to the Bson Document?

if you agree with the above suggestion, then I can make a PR to apply this logic. @bowencode @codingbandit

4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant