Back

[SOLVED] How to get all documents from list_documents?

  • 0
  • Databases
Drake
15 Aug, 2023, 20:44

would you please remove the public access on the collection and try running this again?

TL;DR
User encountered an issue with getting all documents from list_documents. They asked if there is a way to mass create or mass delete. They also mentioned an issue with their API key and rate limiting. The issue resolved when the collection was made private.
ZachHandley
15 Aug, 2023, 20:44

wait now I'm confused

ZachHandley
15 Aug, 2023, 20:44

my API key says never used but

ZachHandley
15 Aug, 2023, 20:44

how else would I be connecting?

ZachHandley
15 Aug, 2023, 20:44

Yeah I'll try

Drake
15 Aug, 2023, 20:44

your collection is public

ZachHandley
15 Aug, 2023, 20:44

okay so I just made it not public

ZachHandley
15 Aug, 2023, 20:46

so if I understand this correctly, if the collection is public it's subject to the rate limits regardless of API key?

Drake
15 Aug, 2023, 20:46

the point is you're not using your api key. something is wrong in your code such that you aren't using the api key

ZachHandley
15 Aug, 2023, 20:47

the only part of my code is initializing the client

Drake
15 Aug, 2023, 20:47

either that or the api key is invalid

ZachHandley
15 Aug, 2023, 20:47

where I do in fact use the API key

ZachHandley
15 Aug, 2023, 20:47

it's fine now

ZachHandley
15 Aug, 2023, 20:47

which means that a public collection doesn't use the API key even if it's present

ZachHandley
15 Aug, 2023, 20:48

my API key now says it was accessed today, (it didn't before, it said never) and I'm no longer getting rate limited, which means it's a public collection bug

ZachHandley
15 Aug, 2023, 20:48

this is the only code I use

TypeScript
DB_ID = "twitterai_db"
CLIENT = (
    Client()
    .set_endpoint("https://appwrite.zachhandley.com/v1")
    .set_project("ai_twitter_bot")
    .set_key(
        "420cbccdeecbbb858e7e72ffe0f112f9e48d43aba1ea3ae4fb6ffbeee94956a8bdbdbc582df5c_MY_API_KEY_MINUS_SOME_STUFF"
    )
)
DATABASES = Databases(CLIENT)


class DBManager:
    def __init__(self):
        self.client = CLIENT
        self.database = DATABASES
ZachHandley
15 Aug, 2023, 20:51

is there a way to mass create or mass delete?

Drake
15 Aug, 2023, 20:52

concurrently call createDocument or deleteDocument

ZachHandley
15 Aug, 2023, 20:58

okay so not really, gotcha, either way, thank you, solved my problem ❤️

Drake
15 Aug, 2023, 20:59

[SOLVED] How to get all documents from list_documents?

ZachHandley
15 Aug, 2023, 20:59

also @Steven if you guys want you shold add to the Appwrite bot a ?solved command or something, the Discord.py bot does that and it's useful so you guys don't need to change titles

ZachHandley
15 Aug, 2023, 20:59

It changes it to [SOLVED] TITLE and turns off replies

D5
15 Aug, 2023, 21:37

@Appwrite bot (mee6) doesn't support that as far as I know

ZachHandley
15 Aug, 2023, 21:46

Want me to write a quick bot to do it?

Drake
16 Aug, 2023, 00:40

that's okay. we'll keep the idea in mind, though

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more