diff --git a/.changeset/chilled-ways-design.md b/.changeset/chilled-ways-design.md new file mode 100644 index 0000000..cfc5814 --- /dev/null +++ b/.changeset/chilled-ways-design.md @@ -0,0 +1,9 @@ +--- +'@rushdb/javascript-sdk': minor +'rushdb-dashboard': minor +'rushdb-core': minor +'rushdb-website': minor +'rushdb-docs': minor +--- + +Update query for fetching property values and minor fixes & cleanups diff --git a/docs/docs/quick-start/creating-and-retrieving-records.md b/docs/docs/quick-start/creating-and-retrieving-records.md index f8eb65f..abfa6d4 100644 --- a/docs/docs/quick-start/creating-and-retrieving-records.md +++ b/docs/docs/quick-start/creating-and-retrieving-records.md @@ -9,21 +9,28 @@ In this section, we'll learn how to use the RushDB SDK to create and retrieve si Ensure that you have initialized the RushDB SDK in your project as follows: +### TypeScript / Javascript ```typescript import RushDB from '@rushdb/javascript-sdk'; const db = new RushDB('API_TOKEN'); ``` +### Python + +```bash +from rushdb import RushDB + +db = RushDB("API_TOKEN") +``` + Replace `API_TOKEN` with your actual API token. ## Creating Records The `create` method allows you to create a single record without registering a model. -### Example - -Creating an author record directly: +### TypeScript / Javascript ```typescript const newAuthor = await db.records.create('author', { name: 'Alice Smith', @@ -35,31 +42,49 @@ const newAuthor = await db.records.create('author', { }); ``` +### Python + +```python +newAuthor = db.records.create( + "author", + { + "name": "Alice Smith", + "email": "alice.smith@example.com", + "jobTitle": "writer", + "age": 28, + "married": True, + "dateOfBirth": "1993-05-15T00:00:00Z" + } +) +``` + + ## Reading Records -The `find`, `findOne`, and `findById` methods let you read records from the database without predefining models. +The `find` method let you read records from the database without predefining models. -### Example +### TypeScript / Javascript -Finding records with specific criteria: ```typescript const authors = await db.records.find('author', { - where: { - jobTitle: { $contains: 'writer' }, - age: { $gte: 25 } - } + where: { + jobTitle: { $contains: 'writer' }, + age: { $gte: 25 } + } }); ``` -### Example +### Python -Finding a single record: -```typescript -const author = await db.records.findOne('author', { - where: { - email: { $contains: 'alice.smith@' } +```python +authors = db.records.find({ + "labels": ["author"] + "where": { + "jobTitle": { "$contains": "writer" }, + "age": { "$gte": 25 } } -}); +}) ``` + This simple flow demonstrates how to create and retrieve records using the RushDB SDK. By defining models and utilizing the SDK's methods, you can easily manage your application's data. Feel free to adapt these examples to fit the specific needs of your project. diff --git a/docs/docs/quick-start/installation.md b/docs/docs/quick-start/installation.md index a3a5638..9e309b2 100644 --- a/docs/docs/quick-start/installation.md +++ b/docs/docs/quick-start/installation.md @@ -6,7 +6,9 @@ Getting started with RushDB SDK is straightforward. This section will guide you ## Step 1: Install the Package -To begin, you need to add the RushDB SDK to your project. You can do this using either npm or yarn: +To begin, you need to add the RushDB SDK to your project. + +### TypeScript / JavaScript Using npm: @@ -19,17 +21,39 @@ Using yarn: yarn add @rushdb/javascript-sdk ``` -### Note on SDK Size -The RushDB SDK is lightweight, coming in at just 5.1kB gzipped. Learn more about the package size [here](https://pkg-size.dev/@rushdb%2Fjavascript-sdk). +Using pnpm: +```bash +pnpm add @rushdb/javascript-sdk +``` + +The RushDB SDK is lightweight, coming in at just 6.9KB gzipped. Learn more about the package size [here](https://pkg-size.dev/@rushdb%2Fjavascript-sdk). + +### Python + +```bash +pip install rushdb +``` ## Step 2: Initialize the SDK Once the package is installed, you can create an instance of the RushDB SDK in your project. + +### TypeScript / JavaScript + ```typescript import RushDB from '@rushdb/javascript-sdk'; const db = new RushDB('API_TOKEN'); ``` -Replace `API_TOKEN` with your actual API token, which you can obtain from the RushDB Dashboard. + +### Python + +```bash +from rushdb import RushDB + +db = RushDB("API_TOKEN") +``` + +Replace `API_TOKEN` with your actual API token, which you can obtain from the [RushDB Dashboard](https://app.rushdb.com/). ## Next steps To make full use of the SDK, you'll need a valid API token. In the [next section](/quick-start/configuring-dashboard), Configuring RushDB Dashboard, we'll guide you through the process of registering on the dashboard, creating a project, and generating your API token. diff --git a/platform/core/src/core/entity/import-export/import.controller.ts b/platform/core/src/core/entity/import-export/import.controller.ts index 7ffce18..126b2d2 100644 --- a/platform/core/src/core/entity/import-export/import.controller.ts +++ b/platform/core/src/core/entity/import-export/import.controller.ts @@ -63,11 +63,7 @@ export class ImportController { ): Promise { const projectId = request.projectId - try { - return await this.importService.importRecords(body, projectId, transaction) - } catch (e) { - console.error(e) - } + return await this.importService.importRecords(body, projectId, transaction) } @Post('/records/import/csv')