@lowdefy/connection-mongodb 0.0.0-experimental-20250915134255 → 0.0.0-experimental-20251010122007
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connections/MongoDBCollection/MongoDBAggregation/documentation.md +101 -0
- package/dist/connections/MongoDBCollection/MongoDBBulkWrite/documentation.md +359 -0
- package/dist/connections/MongoDBCollection/MongoDBDeleteMany/documentation.md +89 -0
- package/dist/connections/MongoDBCollection/MongoDBDeleteOne/documentation.md +92 -0
- package/dist/connections/MongoDBCollection/MongoDBFind/documentation.md +114 -0
- package/dist/connections/MongoDBCollection/MongoDBFindOne/documentation.md +109 -0
- package/dist/connections/MongoDBCollection/MongoDBInsertMany/documentation.md +98 -0
- package/dist/connections/MongoDBCollection/MongoDBInsertOne/documentation.md +94 -0
- package/dist/connections/MongoDBCollection/MongoDBUpdateMany/documentation.md +113 -0
- package/dist/connections/MongoDBCollection/MongoDBUpdateOne/documentation.md +133 -0
- package/dist/connections/MongoDBCollection/documentation.md +137 -0
- package/package.json +3 -3
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
<TITLE>
|
|
2
|
+
MongoDBCollection
|
|
3
|
+
</TITLE>
|
|
4
|
+
|
|
5
|
+
<DESCRIPTION>
|
|
6
|
+
|
|
7
|
+
The `MongoDBCollection` connection sets up a connection to a MongoDB deployment. A [connection URI](https://docs.mongodb.com/manual/reference/connection-string/index.html) with authentication credentials (username and password) is required. The URI can be in the standard or dns seedlist (srv) formats. Connections are defined on a collection level, since this allows for read/write access control on a per collection level. Access control can also be managed using the roles in the database.
|
|
8
|
+
|
|
9
|
+
>Since the connection URI contains authentication secrets, it should be stored using the [`_secret`](operators/secret.md) operator.
|
|
10
|
+
|
|
11
|
+
When using MongoDBUpdateOne and MongoDBDeleteOne requests, take note that the responses differ if the connection has a log collection.
|
|
12
|
+
|
|
13
|
+
### Properties
|
|
14
|
+
|
|
15
|
+
- `databaseUri: string`: __Required__ - Connection uri string for the MongoDb deployment. Should be stored using the [_secret](operators/secret.md) operator.
|
|
16
|
+
- `databaseName: string`: Default: Database specified in connection string - The name of the database in the MongoDB deployment.
|
|
17
|
+
- `collection: string`: __Required__ - The name of the MongoDB collection.
|
|
18
|
+
- `read: boolean`: Default: `true` - Allow read operations like find on the collection.
|
|
19
|
+
- `write: boolean`: Default: `false` - Allow write operations like update on the collection.
|
|
20
|
+
- `options: object`: See the [driver documentation](https://mongodb.github.io/node-mongodb-native/4.0/interfaces/mongoclientoptions.html) for more information.
|
|
21
|
+
|
|
22
|
+
</DESCRIPTION>
|
|
23
|
+
|
|
24
|
+
<REQUESTS>
|
|
25
|
+
|
|
26
|
+
- MongoDBAggregation
|
|
27
|
+
- MongoDBBulkWrite
|
|
28
|
+
- MongoDBDeleteMany
|
|
29
|
+
- MongoDBDeleteOne
|
|
30
|
+
- MongoDBFind
|
|
31
|
+
- MongoDBFindOne
|
|
32
|
+
- MongoDBInsertMany
|
|
33
|
+
- MongoDBInsertOne
|
|
34
|
+
- MongoDBUpdateMany
|
|
35
|
+
- MongoDBUpdateOne
|
|
36
|
+
|
|
37
|
+
</REQUESTS>
|
|
38
|
+
|
|
39
|
+
<SCHEMA>
|
|
40
|
+
|
|
41
|
+
```js
|
|
42
|
+
export default {
|
|
43
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
44
|
+
title: 'Lowdefy Connection Schema - MongoDBCollection',
|
|
45
|
+
type: 'object',
|
|
46
|
+
required: ['databaseUri', 'collection'],
|
|
47
|
+
properties: {
|
|
48
|
+
databaseUri: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
description: 'Connection uri string for the MongoDb deployment.',
|
|
51
|
+
errorMessage: {
|
|
52
|
+
type: 'MongoDBCollection connection property "databaseUri" should be a string.',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
databaseName: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
description: 'Database name.',
|
|
58
|
+
errorMessage: {
|
|
59
|
+
type: 'MongoDBCollection connection property "databaseName" should be a string.',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
collection: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
description: 'Collection name.',
|
|
65
|
+
errorMessage: {
|
|
66
|
+
type: 'MongoDBCollection connection property "collection" should be a string.',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
read: {
|
|
70
|
+
type: 'boolean',
|
|
71
|
+
default: true,
|
|
72
|
+
description: 'Allow reads from the collection.',
|
|
73
|
+
errorMessage: {
|
|
74
|
+
type: 'MongoDBCollection connection property "read" should be a boolean.',
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
write: {
|
|
78
|
+
type: 'boolean',
|
|
79
|
+
default: false,
|
|
80
|
+
description: 'Allow writes to the collection.',
|
|
81
|
+
errorMessage: {
|
|
82
|
+
type: 'MongoDBCollection connection property "write" should be a boolean.',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
errorMessage: {
|
|
87
|
+
type: 'MongoDBCollection connection properties should be an object.',
|
|
88
|
+
required: {
|
|
89
|
+
databaseUri: 'MongoDBCollection connection should have required property "databaseUri".',
|
|
90
|
+
collection: 'MongoDBCollection connection should have required property "collection".',
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
</SCHEMA>
|
|
97
|
+
|
|
98
|
+
<EXAMPLES>
|
|
99
|
+
|
|
100
|
+
### MongoDB collection with reads and writes
|
|
101
|
+
|
|
102
|
+
```yaml
|
|
103
|
+
connections:
|
|
104
|
+
- id: my_collection
|
|
105
|
+
type: MongoDBCollection
|
|
106
|
+
properties:
|
|
107
|
+
databaseUri:
|
|
108
|
+
_secret: MONGODB_URI
|
|
109
|
+
collection: my_collection_name
|
|
110
|
+
write: true
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### MongoDB collection with reads, writes and a log collection
|
|
114
|
+
|
|
115
|
+
```yaml
|
|
116
|
+
connections:
|
|
117
|
+
- id: my_collection
|
|
118
|
+
type: MongoDBCollection
|
|
119
|
+
properties:
|
|
120
|
+
databaseUri:
|
|
121
|
+
_secret: MONGODB_URI
|
|
122
|
+
collection: my_collection_name
|
|
123
|
+
write: true
|
|
124
|
+
changeLog:
|
|
125
|
+
collection: log_collection_name
|
|
126
|
+
meta:
|
|
127
|
+
user:
|
|
128
|
+
_user: true
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Environment variables:
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
LOWDEFY_SECRET_MONGODB_URI = mongodb+srv://username:password@server.example.com/database
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
</EXAMPLES>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lowdefy/connection-mongodb",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-20251010122007",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"homepage": "https://lowdefy.com",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"dist/*"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@lowdefy/helpers": "0.0.0-experimental-
|
|
43
|
+
"@lowdefy/helpers": "0.0.0-experimental-20251010122007",
|
|
44
44
|
"@next-auth/mongodb-adapter": "1.1.3",
|
|
45
45
|
"mongodb": "6.3.0",
|
|
46
46
|
"saslprep": "1.0.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@lowdefy/ajv": "0.0.0-experimental-
|
|
49
|
+
"@lowdefy/ajv": "0.0.0-experimental-20251010122007",
|
|
50
50
|
"@shelf/jest-mongodb": "4.3.2",
|
|
51
51
|
"@swc/cli": "0.1.63",
|
|
52
52
|
"@swc/core": "1.3.99",
|