Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/safakb/appwrite-dummy-data

This package allows you to automatically add millions of data data to Appwrite. It is not ultra-fast, it inserts like real data.
https://github.com/safakb/appwrite-dummy-data

appwrite nodejs realtime

Last synced: 18 days ago
JSON representation

This package allows you to automatically add millions of data data to Appwrite. It is not ultra-fast, it inserts like real data.

Awesome Lists containing this project

README

        

# Appwrite Dummy Data

This package allows you to automatically add **millions** of data data to Appwrite. It is not ultra-fast, it inserts like real data.

## Important

> Don't forget to set _APP_OPTIONS_ABUSE=disabled for limitations such as reading and writing data. This setting is in the .env file

```
_APP_OPTIONS_ABUSE=disabled
```

> After editing the .env file, you need to recreate the containers.

```sh
docker-compose up -d
```

### Setup your client

You should enter your endpoint and project IDs according to your own server information

```js
client
.setEndpoint('https://localhost/v1') // Appwrite server endpoint
.setProject('XXXXXXXXXXXXXXX'); // Project ID
```

### Record Count
You can specify how many records to add
```js
const count = 250000;
```

### Schema
Remember to set your data schema inside the loop. You should set it according to your own collection

```js
...
let dummyData =
{
title: "Example Name " + i,
description: "Example Description" + i,
content: "Example Content" + i,
enabled: i % 2 == 0 ? true : false,
};
...
```

### Finally edit
And finally add your databaseId and collectionId information here

```js
...
database.createDocument('XXXXXXXXXXXXXXX', 'XXXXXXXXXXXXXXXX', 'unique()', dummyData)
...
```

### Now you can run the script

```ssh
npm install appwrite
npm run start
```