Skip to content

Commit d18c4f4

Browse files
committed
backup-collection-query
1 parent ae63f89 commit d18c4f4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/backup.mjs

+5-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const DOCUMENTS_PAGE_SIZE = 100;
2323

2424
const FILE_READ_DELAY = 1_000;
2525

26+
2627
const client = new sdk.Client();
2728

2829
client.setEndpoint(process.env.APPWRITE_ENDPOINT)
@@ -111,7 +112,10 @@ await fs.mkdir("backup/databases", { recursive: true });
111112
console.log(`Found ${total} databases!`);
112113
for (const database of databasesList) {
113114
const { collections, total } = await databases.listCollections(
114-
database.$id
115+
database.$id,
116+
[
117+
sdk.Query.limit(5_000)
118+
]
115119
);
116120
console.log(`Found ${total} collections id ${database.$id}!`);
117121
for (const collection of collections) {

0 commit comments

Comments
 (0)