Find answers from the community

Updated 2 years ago

hey there hoping you can help me

At a glance
hey there, hoping you can help me understand this issue I am having using SimpleMongoReader. I am a python noob, so not sure if I'm missing something obvious.

Essentially my code is:
db_name = "shopify" collection_name = "products" # query_dict is passed into db.collection.find() query_dict = {"id":8064484278565} reader = SimpleMongoReader(host, port) documents = reader.load_data(db_name, collection_name, query_dict=query_dict)

But I'm getting this error.
Traceback (most recent call last): File "create-index.py", line 13, in <module> documents = reader.load_data(db_name, collection_name, query_dict) TypeError: load_data() takes 1 positional argument but 4 were given
j
b
4 comments
@blackswan i'll working on improving the interface here, in the meantime you need to specify keyword arguments during load_data

e.g. reader.load_data(db_name=db_name, collection_name=collection_name, query_dict=query_dict)
ah gotcha, thank you!
You're doing amazing work btw πŸ™‚
https://github.com/jerryjliu/gpt_index/pull/193 - once this lands + gets packaged in the next release, your original command should work
Add a reply
Sign up and join the conversation on Discord