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

some questions about the queue_id ...... #1

Open
furuiyang0715 opened this issue Feb 16, 2019 · 1 comment
Open

some questions about the queue_id ...... #1

furuiyang0715 opened this issue Feb 16, 2019 · 1 comment

Comments

@furuiyang0715
Copy link

image

I should transform the string into ObjectId, if I want to query and delete it from the mongodb ...

        for queue_id in to_delete:

            # transform
            import bson
            queue_id = bson.ObjectId(queue_id)

            try:
                self.mongo.delete_from_queue({'_id': queue_id})
            except Exception as e:
                self.logger.error('Cannot delete document from queue Error: ' + str(e))
@furuiyang0715
Copy link
Author

furuiyang0715 commented Feb 16, 2019

image
Hello, I feel happy to know your excellent code, however, I am not very good at English,I try to express my point clearly ...
If I have a primary key with the int type, and I transform it into str here, I can't find the data to delete by using "self.mongo.delete(doc=doc['values'], schema=doc['schema'], collection=doc['table'], primary_key=primary_key)"

the same problem appears here:
image

I think it's because when parse the dumpfile, "int--> str" by "doc[child.attrib['name']] = child.text"
image

but when we use python-mysql-replication, it can keep "int" still "int" ....

I think it can be solved like this:
image

image

image

thank you a lot......

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