diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..a35c2aa
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,11 @@
+# To get started with Dependabot version updates, you'll need to specify which
+# package ecosystems to update and where the package manifests are located.
+# Please see the documentation for all configuration options:
+# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
+
+version: 2
+updates:
+ - package-ecosystem: "gradle" # See documentation for possible values
+ directory: "/" # Location of package manifests
+ schedule:
+ interval: "weekly"
diff --git a/.github/workflows/gradle-publish.yml b/.github/workflows/gradle-publish.yml
new file mode 100644
index 0000000..3ba65c0
--- /dev/null
+++ b/.github/workflows/gradle-publish.yml
@@ -0,0 +1,60 @@
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
+# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
+
+name: Release
+on:
+ push:
+ branches:
+ - main
+ - rc
+ - beta
+ - alpha
+ - "*.x"
+
+jobs:
+ get-next-version:
+ uses: lenra-io/github-actions/.github/workflows/get-version.yml@main
+
+ release:
+ needs: [get-next-version]
+ if: ${{ needs.get-next-version.outputs.will-release == 'true' }}
+ uses: lenra-io/github-actions/.github/workflows/release.yml@main
+
+ publish:
+ name: publish
+ needs: [get-next-version]
+ if: ${{ needs.get-next-version.outputs.will-release == 'true' }}
+ runs-on: ubuntu-latest
+ env:
+ VERSION: ${{ needs.get-next-version.outputs.version }}
+ permissions:
+ contents: read
+ packages: write
+
+ steps:
+ - uses: actions/checkout@v4
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ java-version: '17'
+ distribution: 'temurin'
+ server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
+ settings-path: ${{ github.workspace }} # location for the settings.xml file
+
+ - name: Setup Gradle
+ uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
+
+ - run: sed -E "s/^(version\s*=\s*)(.+)\$/\1${{ env.VERSION }}/" -i gradle.properties
+
+ - name: Build with Gradle
+ run: ./gradlew build
+
+ - name: Publish to GitHub Packages
+ run: ./gradlew publish
+ env:
+ NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
+ NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml
deleted file mode 100644
index c4ae299..0000000
--- a/.github/workflows/maven.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
-# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
-#
-# This file is auto-generated by OpenAPI Generator (https://openapi-generator.tech)
-
-name: Java CI with Maven
-
-on:
- push:
- branches: [ main, master ]
- pull_request:
- branches: [ main, master ]
-
-jobs:
- build:
- name: Build Lenra server internal API
- runs-on: ubuntu-latest
- strategy:
- matrix:
- java: [ '8' ]
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK
- uses: actions/setup-java@v2
- with:
- java-version: ${{ matrix.java }}
- distribution: 'temurin'
- cache: maven
- - name: Build with Maven
- run: mvn -B package --no-transfer-progress --file pom.xml
diff --git a/.gitignore b/.gitignore
index a530464..327f1e9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,5 @@ hs_err_pid*
target
.gradle
build
+
+/api/
diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES
index 872e5bc..9794fd8 100644
--- a/.openapi-generator/FILES
+++ b/.openapi-generator/FILES
@@ -5,8 +5,10 @@ api/openapi.yaml
build.gradle
build.sbt
docs/DataApi.md
-docs/DataDocument.md
+docs/DataOptions.md
docs/FindDocumentsRequest.md
+docs/InsertManyDocuments200Response.md
+docs/InsertManyDocumentsRequest.md
docs/UpdateManyDocumentsRequest.md
git_push.sh
gradle.properties
@@ -35,6 +37,11 @@ src/main/java/io/lenra/api/internal/auth/HttpBasicAuth.java
src/main/java/io/lenra/api/internal/auth/HttpBearerAuth.java
src/main/java/io/lenra/api/internal/client/DataApi.java
src/main/java/io/lenra/api/internal/client/model/AbstractOpenApiSchema.java
-src/main/java/io/lenra/api/internal/client/model/DataDocument.java
+src/main/java/io/lenra/api/internal/client/model/DataOptions.java
src/main/java/io/lenra/api/internal/client/model/FindDocumentsRequest.java
+src/main/java/io/lenra/api/internal/client/model/InsertManyDocuments200Response.java
+src/main/java/io/lenra/api/internal/client/model/InsertManyDocumentsRequest.java
src/main/java/io/lenra/api/internal/client/model/UpdateManyDocumentsRequest.java
+src/test/java/io/lenra/api/internal/client/model/DataOptionsTest.java
+src/test/java/io/lenra/api/internal/client/model/InsertManyDocuments200ResponseTest.java
+src/test/java/io/lenra/api/internal/client/model/InsertManyDocumentsRequestTest.java
diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION
index 40e3636..c9e125b 100644
--- a/.openapi-generator/VERSION
+++ b/.openapi-generator/VERSION
@@ -1 +1 @@
-7.1.0-SNAPSHOT
\ No newline at end of file
+7.4.0-SNAPSHOT
diff --git a/README.md b/README.md
index 8e8b775..0f04c0b 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,15 @@
# lenra-internal-api-client
+```bash
+# Load API
+## With wget
+wget https://github.com/lenra-io/api/releases/latest/download/load-api.sh -O - -q | bash
+## With curl
+curl -fsSL https://github.com/lenra-io/api/releases/latest/download/load-api.sh | bash
+```
+
+Generate
+
```bash
docker run --rm -v ${PWD}:/local --workdir /local openapitools/openapi-generator-cli batch /local/gen-conf/java.yml
```
diff --git a/api/api-version.txt b/api/api-version.txt
deleted file mode 100644
index 6d7de6e..0000000
--- a/api/api-version.txt
+++ /dev/null
@@ -1 +0,0 @@
-1.0.2
diff --git a/api/api.tar.gz b/api/api.tar.gz
deleted file mode 100644
index da5c019..0000000
Binary files a/api/api.tar.gz and /dev/null differ
diff --git a/api/internal-api.yml b/api/internal-api.yml
deleted file mode 100644
index 068fd69..0000000
--- a/api/internal-api.yml
+++ /dev/null
@@ -1,316 +0,0 @@
-openapi: 3.1.0
-info:
- title: Lenra server internal API
- description: The API usable by the Lenra applications
- license:
- name: MIT
- url: https://opensource.org/licenses/MIT
- version: 0.0.0
- contact:
- name: Lenra
- url: https://www.lenra.io/contact.html
-servers:
- - url: http://localhost:4001
- description: Devtool
-tags:
- - name: Data
- description: Data management API
-components:
- securitySchemes:
- bearerAuth:
- type: http
- scheme: bearer
- schemas:
- data.document:
- title: Document
- description: A document in MongoDB database
- type: object
- properties:
- _id:
- type: string
- description: The document identifier
- additionalProperties: true
- data.query:
- title: Query
- description: Mongo data query
- type: object
- properties: {}
- additionalProperties: true
- data.result.find:
- title: FindResult
- description: Find query result.
- type: object
- additionalProperties: {}
- data.update:
- title: Query
- description: Mongo data query
- type: object
- additionalProperties: true
-security:
- - bearerAuth:
- - api
- - transaction
-paths:
- /app-api/v1-api/v1/data/colls/{coll}:
- delete:
- tags:
- - Data
- summary: Deletes a collection from database
- operationId: deleteCollection
- parameters:
- - name: coll
- in: path
- description: The document collection name
- required: true
- schema:
- type: string
- responses:
- "200":
- description: Collection deleted
- /app-api/v1/data/colls/{coll}/docs:
- get:
- tags:
- - Data
- summary: Gets documents from database
- operationId: getDocuments
- parameters:
- - name: coll
- in: path
- description: The document collection name
- required: true
- schema:
- type: string
- responses:
- "200":
- description: Documents found
- content:
- application/json:
- schema:
- type: array
- items:
- $ref: "#/components/schemas/data.document"
- post:
- tags:
- - Data
- summary: Creates a document in database
- operationId: createDocument
- parameters:
- - name: coll
- in: path
- description: The document collection name
- required: true
- schema:
- type: string
- requestBody:
- description: The document to create
- required: true
- content:
- application/json:
- schema:
- type: object
- responses:
- "200":
- description: Document created
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/data.document"
- /app-api/v1/data/colls/{coll}/docs/{id}:
- get:
- tags:
- - Data
- summary: Gets a document from database
- operationId: getDocumentById
- parameters:
- - name: coll
- in: path
- description: The document collection name
- required: true
- schema:
- type: string
- - name: id
- in: path
- description: The document identifier
- required: true
- schema:
- type: string
- responses:
- "200":
- description: Document created
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/data.document"
- put:
- tags:
- - Data
- summary: Updates a document in database
- operationId: updateDocumentById
- parameters:
- - name: coll
- in: path
- description: The document collection name
- required: true
- schema:
- type: string
- - name: id
- in: path
- description: The document identifier
- required: true
- schema:
- type: string
- requestBody:
- description: The document to update
- required: true
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/data.document"
- responses:
- "200":
- description: Document updated
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/data.document"
- delete:
- tags:
- - Data
- summary: Deletes a document from database
- operationId: deleteDocumentById
- parameters:
- - name: coll
- in: path
- description: The document collection name
- required: true
- schema:
- type: string
- - name: id
- in: path
- description: The document identifier
- required: true
- schema:
- type: string
- responses:
- "200":
- description: Document deleted
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/data.document"
- /app-api/v1/data/colls/{coll}/find:
- post:
- tags:
- - Data
- summary: Finds documents in database
- operationId: findDocuments
- parameters:
- - name: coll
- in: path
- description: The document collection name
- required: true
- schema:
- type: string
- requestBody:
- description: The query to find documents
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- query:
- $ref: "#/components/schemas/data.query"
- projection:
- type: object
- nullable: true
- additionalProperties: true
- required:
- - query
- additionalProperties: false
- responses:
- "200":
- description: Documents found
- content:
- application/json:
- schema:
- $ref: "#/components/schemas/data.result.find"
- /app-api/v1/data/colls/{coll}/updateMany:
- post:
- tags:
- - Data
- summary: Updates many documents in database
- operationId: updateManyDocuments
- parameters:
- - name: coll
- in: path
- description: The document collection name
- required: true
- schema:
- type: string
- requestBody:
- description: The query to find documents
- required: true
- content:
- application/json:
- schema:
- type: object
- properties:
- filter:
- $ref: "#/components/schemas/data.query"
- nullable: false
- update:
- $ref: "#/components/schemas/data.update"
- nullable: false
- required:
- - filter
- - update
- additionalProperties: false
- responses:
- "200":
- description: Documents updated
- content:
- application/json:
- schema:
- type: object
- /app-api/v1/data/transaction:
- post:
- tags:
- - Data
- summary: Creates a transaction
- operationId: createTransaction
- security:
- - bearerAuth:
- - api
- responses:
- "200":
- description: Transaction created
- content:
- application/json:
- schema:
- description: The transaction token
- type: string
- /app-api/v1/data/transaction/commit:
- post:
- tags:
- - Data
- summary: Commits a transaction
- operationId: commitTransaction
- security:
- - bearerAuth:
- - transaction
- responses:
- "200":
- description: Transaction commited
- /app-api/v1/data/transaction/abort:
- post:
- tags:
- - Data
- summary: Aborts a transaction
- operationId: abortTransaction
- security:
- - bearerAuth:
- - transaction
- responses:
- "200":
- description: Transaction aborted
diff --git a/api/openapi.yaml b/api/openapi.yaml
deleted file mode 100644
index 2eee8f6..0000000
--- a/api/openapi.yaml
+++ /dev/null
@@ -1,365 +0,0 @@
-openapi: 3.1.0
-info:
- contact:
- name: Lenra
- url: https://www.lenra.io/contact.html
- description: The API usable by the Lenra applications
- license:
- name: MIT
- url: https://opensource.org/licenses/MIT
- title: Lenra server internal API
- version: 0.0.0
-servers:
-- description: Devtool
- url: http://localhost:4001
-security:
-- bearerAuth:
- - api
- - transaction
-tags:
-- description: Data management API
- name: Data
-paths:
- /app-api/v1-api/v1/data/colls/{coll}:
- delete:
- operationId: deleteCollection
- parameters:
- - description: The document collection name
- explode: false
- in: path
- name: coll
- required: true
- schema:
- type: string
- style: simple
- responses:
- "200":
- description: Collection deleted
- summary: Deletes a collection from database
- tags:
- - Data
- x-accepts: application/json
- /app-api/v1/data/colls/{coll}/docs:
- get:
- operationId: getDocuments
- parameters:
- - description: The document collection name
- explode: false
- in: path
- name: coll
- required: true
- schema:
- type: string
- style: simple
- responses:
- "200":
- content:
- application/json:
- schema:
- items:
- $ref: '#/components/schemas/data.document'
- type: array
- description: Documents found
- summary: Gets documents from database
- tags:
- - Data
- x-accepts: application/json
- post:
- operationId: createDocument
- parameters:
- - description: The document collection name
- explode: false
- in: path
- name: coll
- required: true
- schema:
- type: string
- style: simple
- requestBody:
- content:
- application/json:
- schema:
- type: object
- description: The document to create
- required: true
- responses:
- "200":
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/data.document'
- description: Document created
- summary: Creates a document in database
- tags:
- - Data
- x-content-type: application/json
- x-accepts: application/json
- /app-api/v1/data/colls/{coll}/docs/{id}:
- delete:
- operationId: deleteDocumentById
- parameters:
- - description: The document collection name
- explode: false
- in: path
- name: coll
- required: true
- schema:
- type: string
- style: simple
- - description: The document identifier
- explode: false
- in: path
- name: id
- required: true
- schema:
- type: string
- style: simple
- responses:
- "200":
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/data.document'
- description: Document deleted
- summary: Deletes a document from database
- tags:
- - Data
- x-accepts: application/json
- get:
- operationId: getDocumentById
- parameters:
- - description: The document collection name
- explode: false
- in: path
- name: coll
- required: true
- schema:
- type: string
- style: simple
- - description: The document identifier
- explode: false
- in: path
- name: id
- required: true
- schema:
- type: string
- style: simple
- responses:
- "200":
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/data.document'
- description: Document created
- summary: Gets a document from database
- tags:
- - Data
- x-accepts: application/json
- put:
- operationId: updateDocumentById
- parameters:
- - description: The document collection name
- explode: false
- in: path
- name: coll
- required: true
- schema:
- type: string
- style: simple
- - description: The document identifier
- explode: false
- in: path
- name: id
- required: true
- schema:
- type: string
- style: simple
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/data.document'
- description: The document to update
- required: true
- responses:
- "200":
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/data.document'
- description: Document updated
- summary: Updates a document in database
- tags:
- - Data
- x-content-type: application/json
- x-accepts: application/json
- /app-api/v1/data/colls/{coll}/find:
- post:
- operationId: findDocuments
- parameters:
- - description: The document collection name
- explode: false
- in: path
- name: coll
- required: true
- schema:
- type: string
- style: simple
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/findDocuments_request'
- description: The query to find documents
- required: true
- responses:
- "200":
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/data.result.find'
- description: Documents found
- summary: Finds documents in database
- tags:
- - Data
- x-content-type: application/json
- x-accepts: application/json
- /app-api/v1/data/colls/{coll}/updateMany:
- post:
- operationId: updateManyDocuments
- parameters:
- - description: The document collection name
- explode: false
- in: path
- name: coll
- required: true
- schema:
- type: string
- style: simple
- requestBody:
- content:
- application/json:
- schema:
- $ref: '#/components/schemas/updateManyDocuments_request'
- description: The query to find documents
- required: true
- responses:
- "200":
- content:
- application/json:
- schema:
- type: object
- description: Documents updated
- summary: Updates many documents in database
- tags:
- - Data
- x-content-type: application/json
- x-accepts: application/json
- /app-api/v1/data/transaction:
- post:
- operationId: createTransaction
- responses:
- "200":
- content:
- application/json:
- schema:
- description: The transaction token
- type: string
- description: Transaction created
- security:
- - bearerAuth:
- - api
- summary: Creates a transaction
- tags:
- - Data
- x-accepts: application/json
- /app-api/v1/data/transaction/commit:
- post:
- operationId: commitTransaction
- responses:
- "200":
- description: Transaction commited
- security:
- - bearerAuth:
- - transaction
- summary: Commits a transaction
- tags:
- - Data
- x-accepts: application/json
- /app-api/v1/data/transaction/abort:
- post:
- operationId: abortTransaction
- responses:
- "200":
- description: Transaction aborted
- security:
- - bearerAuth:
- - transaction
- summary: Aborts a transaction
- tags:
- - Data
- x-accepts: application/json
-components:
- schemas:
- data.document:
- additionalProperties: true
- description: A document in MongoDB database
- example:
- _id: _id
- properties:
- _id:
- description: The document identifier
- type: string
- title: Document
- data.query:
- additionalProperties: true
- description: Mongo data query
- properties: {}
- title: Query
- type: object
- data.result.find:
- additionalProperties: true
- description: Find query result.
- title: FindResult
- type: object
- data.update:
- additionalProperties: true
- description: Mongo data query
- title: Query
- type: object
- findDocuments_request:
- additionalProperties: {}
- properties:
- query:
- additionalProperties: true
- description: Mongo data query
- properties: {}
- title: Query
- type: object
- projection:
- additionalProperties: {}
- nullable: true
- required:
- - query
- updateManyDocuments_request:
- additionalProperties: {}
- properties:
- filter:
- additionalProperties: true
- description: Mongo data query
- properties: {}
- title: Query
- type: object
- update:
- additionalProperties: true
- description: Mongo data query
- title: Query
- type: object
- required:
- - filter
- - update
- securitySchemes:
- bearerAuth:
- scheme: bearer
- type: http
-
diff --git a/build.gradle b/build.gradle
index c8ae406..75bce10 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,17 +2,15 @@ apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'java'
apply plugin: 'com.diffplug.spotless'
+apply plugin: 'maven-publish'
group = 'io.lenra'
-version = '1.0.0'
buildscript {
repositories {
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.+'
- classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.diffplug.spotless:spotless-plugin-gradle:6.11.0'
}
}
@@ -20,85 +18,29 @@ buildscript {
repositories {
mavenCentral()
}
-sourceSets {
- main.java.srcDirs = ['src/main/java']
-}
-
-if(hasProperty('target') && target == 'android') {
-
- apply plugin: 'com.android.library'
- apply plugin: 'com.github.dcendents.android-maven'
- android {
- compileSdkVersion 25
- buildToolsVersion '25.0.2'
- defaultConfig {
- minSdkVersion 14
- targetSdkVersion 25
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
+sourceCompatibility = JavaVersion.VERSION_17
+targetCompatibility = JavaVersion.VERSION_17
- // Rename the aar correctly
- libraryVariants.all { variant ->
- variant.outputs.each { output ->
- def outputFile = output.outputFile
- if (outputFile != null && outputFile.name.endsWith('.aar')) {
- def fileName = "${project.name}-${variant.baseName}-${version}.aar"
- output.outputFile = new File(outputFile.parent, fileName)
- }
+publishing {
+ repositories {
+ maven {
+ credentials {
+ username "${System.env.NEXUS_USERNAME}"
+ password "${System.env.NEXUS_PASSWORD}"
}
- }
-
- dependencies {
- provided "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
- }
- }
-
- afterEvaluate {
- android.libraryVariants.all { variant ->
- def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
- task.description = "Create jar artifact for ${variant.name}"
- task.dependsOn variant.javaCompile
- task.from variant.javaCompile.destinationDirectory
- task.destinationDirectory = project.file("${project.buildDir}/outputs/jar")
- task.archiveFileName = "${project.name}-${variant.baseName}-${version}.jar"
- artifacts.add('archives', task)
+ if(project.version.endsWith('-SNAPSHOT'))
+ url "https://oss.sonatype.org/content/repositories/snapshots"
+ else
+ url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
}
}
-
- task sourcesJar(type: Jar) {
- from android.sourceSets.main.java.srcDirs
- classifier = 'sources'
- }
-
- artifacts {
- archives sourcesJar
- }
-
-} else {
-
- apply plugin: 'java'
- apply plugin: 'maven-publish'
-
- sourceCompatibility = JavaVersion.VERSION_1_8
- targetCompatibility = JavaVersion.VERSION_1_8
-
- publishing {
- publications {
- maven(MavenPublication) {
- artifactId = 'lenra-internal-api-client'
- from components.java
- }
+ publications {
+ maven(MavenPublication) {
+ artifactId = 'lenra-internal-api-client'
+ from components.java
}
}
-
- task execute(type:JavaExec) {
- main = System.getProperty('mainClass')
- classpath = sourceSets.main.runtimeClasspath
- }
}
ext {
diff --git a/docs/DataApi.md b/docs/DataApi.md
index 5b8382c..ad20718 100644
--- a/docs/DataApi.md
+++ b/docs/DataApi.md
@@ -6,13 +6,14 @@ All URIs are relative to *http://localhost:4001*
|------------- | ------------- | -------------|
| [**abortTransaction**](DataApi.md#abortTransaction) | **POST** /app-api/v1/data/transaction/abort | Aborts a transaction |
| [**commitTransaction**](DataApi.md#commitTransaction) | **POST** /app-api/v1/data/transaction/commit | Commits a transaction |
-| [**createDocument**](DataApi.md#createDocument) | **POST** /app-api/v1/data/colls/{coll}/docs | Creates a document in database |
+| [**createDocument**](DataApi.md#createDocument) | **POST** /app-api/v1/data/colls/{coll}/docs | Creates one document in database |
| [**createTransaction**](DataApi.md#createTransaction) | **POST** /app-api/v1/data/transaction | Creates a transaction |
| [**deleteCollection**](DataApi.md#deleteCollection) | **DELETE** /app-api/v1-api/v1/data/colls/{coll} | Deletes a collection from database |
| [**deleteDocumentById**](DataApi.md#deleteDocumentById) | **DELETE** /app-api/v1/data/colls/{coll}/docs/{id} | Deletes a document from database |
| [**findDocuments**](DataApi.md#findDocuments) | **POST** /app-api/v1/data/colls/{coll}/find | Finds documents in database |
| [**getDocumentById**](DataApi.md#getDocumentById) | **GET** /app-api/v1/data/colls/{coll}/docs/{id} | Gets a document from database |
| [**getDocuments**](DataApi.md#getDocuments) | **GET** /app-api/v1/data/colls/{coll}/docs | Gets documents from database |
+| [**insertManyDocuments**](DataApi.md#insertManyDocuments) | **POST** /app-api/v1/data/colls/{coll}/insertMany | Inserts many documents in database |
| [**updateDocumentById**](DataApi.md#updateDocumentById) | **PUT** /app-api/v1/data/colls/{coll}/docs/{id} | Updates a document in database |
| [**updateManyDocuments**](DataApi.md#updateManyDocuments) | **POST** /app-api/v1/data/colls/{coll}/updateMany | Updates many documents in database |
@@ -139,9 +140,9 @@ null (empty response body)
# **createDocument**
-> DataDocument createDocument(coll, body)
+> Map<String, Object> createDocument(coll, body)
-Creates a document in database
+Creates one document in database
### Example
```java
@@ -166,7 +167,7 @@ public class Example {
String coll = "coll_example"; // String | The document collection name
Object body = null; // Object | The document to create
try {
- DataDocument result = apiInstance.createDocument(coll, body);
+ Map result = apiInstance.createDocument(coll, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DataApi#createDocument");
@@ -188,7 +189,7 @@ public class Example {
### Return type
-[**DataDocument**](DataDocument.md)
+**Map<String, Object>**
### Authorization
@@ -331,7 +332,7 @@ null (empty response body)
# **deleteDocumentById**
-> DataDocument deleteDocumentById(coll, id)
+> Map<String, Object> deleteDocumentById(coll, id)
Deletes a document from database
@@ -358,7 +359,7 @@ public class Example {
String coll = "coll_example"; // String | The document collection name
String id = "id_example"; // String | The document identifier
try {
- DataDocument result = apiInstance.deleteDocumentById(coll, id);
+ Map result = apiInstance.deleteDocumentById(coll, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling DataApi#deleteDocumentById");
@@ -380,7 +381,7 @@ public class Example {
### Return type
-[**DataDocument**](DataDocument.md)
+**Map<String, Object>**
### Authorization
@@ -398,7 +399,7 @@ public class Example {
# **findDocuments**
-> Map<String, Object> findDocuments(coll, findDocumentsRequest)
+> List<Map<String, Object>> findDocuments(coll, findDocumentsRequest)
Finds documents in database
@@ -425,7 +426,7 @@ public class Example {
String coll = "coll_example"; // String | The document collection name
FindDocumentsRequest findDocumentsRequest = new FindDocumentsRequest(); // FindDocumentsRequest | The query to find documents
try {
- Map result = apiInstance.findDocuments(coll, findDocumentsRequest);
+ List