n8n-nodes-couchbase 0.1.0 → 0.1.2
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/README.md +60 -33
- package/dist/credentials/CouchbaseCredentialsApi.credentials.d.ts +2 -3
- package/dist/credentials/CouchbaseCredentialsApi.credentials.js +29 -25
- package/dist/credentials/CouchbaseCredentialsApi.credentials.js.map +1 -1
- package/dist/nodes/{ExampleNode → CouchbaseDB}/CouchbaseNode.node.js +57 -85
- package/dist/nodes/CouchbaseDB/CouchbaseNode.node.js.map +1 -0
- package/dist/nodes/CouchbaseNode/CouchbaseNode.node.js +40 -108
- package/dist/nodes/CouchbaseNode/CouchbaseNode.node.js.map +1 -1
- package/dist/package.json +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/credentials/ExampleCredentialsApi.credentials.d.ts +0 -8
- package/dist/credentials/ExampleCredentialsApi.credentials.js +0 -46
- package/dist/credentials/ExampleCredentialsApi.credentials.js.map +0 -1
- package/dist/credentials/HttpBinApi.credentials.d.ts +0 -9
- package/dist/credentials/HttpBinApi.credentials.js +0 -40
- package/dist/credentials/HttpBinApi.credentials.js.map +0 -1
- package/dist/nodes/CouchbaseDB/CouchbaseDB.node.d.ts +0 -6
- package/dist/nodes/CouchbaseDB/CouchbaseDB.node.js +0 -274
- package/dist/nodes/CouchbaseDB/CouchbaseDB.node.js.map +0 -1
- package/dist/nodes/CouchbaseNode/CouchbaseDb.node.d.ts +0 -6
- package/dist/nodes/CouchbaseNode/CouchbaseDb.node.js +0 -274
- package/dist/nodes/CouchbaseNode/CouchbaseDb.node.js.map +0 -1
- package/dist/nodes/ExampleNode/CBLogomark.svg +0 -350
- package/dist/nodes/ExampleNode/CouchbaseNode.node.js.map +0 -1
- package/dist/nodes/ExampleNode/ExampleNode.node.d.ts +0 -6
- package/dist/nodes/ExampleNode/ExampleNode.node.js +0 -234
- package/dist/nodes/ExampleNode/ExampleNode.node.js.map +0 -1
- /package/dist/nodes/{ExampleNode → CouchbaseDB}/CouchbaseNode.node.d.ts +0 -0
package/README.md
CHANGED
|
@@ -1,47 +1,74 @@
|
|
|
1
|
-
|
|
1
|
+
N8N Nodes Couchbase
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The Couchbase node allows you to automate documents in Couchbase. n8n has built-in support for a wide range of Couchbase features, including executing, inserting, updating, removing, and finding documents. n8n is a free and source-available workflow automation platform.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Use this connector
|
|
6
6
|
|
|
7
|
-
To
|
|
7
|
+
To install a community node in your n8n instance :
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
• Go to Settings > Community Nodes :
|
|
10
|
+
• Select 'Install a community node'
|
|
11
|
+
• Type in "n8n-nodes-couchbase" and hit Install
|
|
12
|
+
|
|
13
|
+
For more information on installing community nodes, visit the Community nodes docs page.
|
|
14
|
+
|
|
15
|
+
Features
|
|
16
|
+
|
|
17
|
+
• Insert documents
|
|
18
|
+
• Update documents
|
|
19
|
+
• Find documents
|
|
20
|
+
• Remove documents
|
|
21
|
+
|
|
22
|
+
Couchbase Credentials
|
|
23
|
+
|
|
24
|
+
Create a Couchbase account and you will need to input the following:
|
|
25
|
+
|
|
26
|
+
• Connection String
|
|
27
|
+
|
|
28
|
+
1. Couchbase Server, you can use this connection string couchbase://127.0.0.1/?connectionTimeout=1200
|
|
29
|
+
|
|
30
|
+
2. Couchbase Capella, you can navigate to the tab named Connect and copy the connection string.
|
|
31
|
+
|
|
32
|
+
• Username
|
|
33
|
+
• Password
|
|
34
|
+
• Bucket
|
|
35
|
+
• Scope
|
|
36
|
+
• Collection
|
|
37
|
+
|
|
38
|
+
Those credentials are needed in order for you to connect to Couchbase.
|
|
39
|
+
|
|
40
|
+
Example Usage
|
|
41
|
+
|
|
42
|
+
This workflow allows you to insert a document into a Couchbase. This example usage workflow would use the following three nodes. - Start - Set - Couchbase
|
|
43
|
+
|
|
44
|
+
The final workflow should look like the following image.
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
<img width="468" alt="image" src="https://github.com/maruakinu/n8n-nodes-couchbase/assets/100325935/b7947dde-af19-4b40-9c85-b1c5716fa332">
|
|
48
|
+
|
|
49
|
+
1. Start node
|
|
50
|
+
The start node exists by default when you create a new workflow.
|
|
51
|
+
|
|
52
|
+
2. Set node
|
|
53
|
+
|
|
54
|
+
1. Click on the Add Value button and select 'String' from the dropdown list.
|
|
55
|
+
2. Enter the Property Name of the Value in the Name field.
|
|
56
|
+
3. Enter the value for the name in the Value field.
|
|
57
|
+
4. Click on Execute Node to run the node.
|
|
58
|
+
|
|
59
|
+
3. Couchbase node (Inserting Data)
|
|
60
|
+
|
|
61
|
+
1. Select 'Insert' from the Operation dropdown list.
|
|
62
|
+
2. You will have to enter credentials for the Couchbase. Click the Couchbase Node and enter your credentials.
|
|
63
|
+
3. At the bottom, enter the value that you want to insert in Couchbase.
|
|
64
|
+
4. Click on Execute Node to run the node.
|
|
10
65
|
|
|
11
|
-
You need the following installed on your development machine:
|
|
12
66
|
|
|
13
|
-
* [git](https://git-scm.com/downloads)
|
|
14
|
-
* Node.js and npm. Minimum version Node 16. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL [here](https://github.com/nvm-sh/nvm). For Windows users, refer to Microsoft's guide to [Install NodeJS on Windows](https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows).
|
|
15
|
-
* Install n8n with:
|
|
16
|
-
```
|
|
17
|
-
npm install n8n -g
|
|
18
|
-
```
|
|
19
|
-
* Recommended: follow n8n's guide to [set up your development environment](https://docs.n8n.io/integrations/creating-nodes/build/node-development-environment/).
|
|
20
67
|
|
|
21
68
|
|
|
22
|
-
## Using this starter
|
|
23
69
|
|
|
24
|
-
These are the basic steps for working with the starter. For detailed guidance on creating and publishing nodes, refer to the [documentation](https://docs.n8n.io/integrations/creating-nodes/).
|
|
25
70
|
|
|
26
|
-
1. [Generate a new repository](https://github.com/n8n-io/n8n-nodes-starter/generate) from this template repository.
|
|
27
|
-
2. Clone your new repo:
|
|
28
|
-
```
|
|
29
|
-
git clone https://github.com/<your organization>/<your-repo-name>.git
|
|
30
|
-
```
|
|
31
|
-
3. Run `npm i` to install dependencies.
|
|
32
|
-
4. Open the project in your editor.
|
|
33
|
-
5. Browse the examples in `/nodes` and `/credentials`. Modify the examples, or replace them with your own nodes.
|
|
34
|
-
6. Update the `package.json` to match your details.
|
|
35
|
-
7. Run `npm run lint` to check for errors or `npm run lintfix` to automatically fix errors when possible.
|
|
36
|
-
8. Test your node locally. Refer to [Run your node locally](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) for guidance.
|
|
37
|
-
9. Replace this README with documentation for your node. Use the [README_TEMPLATE](README_TEMPLATE.md) to get started.
|
|
38
|
-
10. Update the LICENSE file to use your details.
|
|
39
|
-
11. [Publish](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry) your package to npm.
|
|
40
71
|
|
|
41
|
-
## More information
|
|
42
72
|
|
|
43
|
-
Refer to our [documentation on creating nodes](https://docs.n8n.io/integrations/creating-nodes/) for detailed information on building your own nodes.
|
|
44
73
|
|
|
45
|
-
## License
|
|
46
74
|
|
|
47
|
-
[MIT](https://github.com/n8n-io/n8n-nodes-starter/blob/master/LICENSE.md)
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
2
|
export declare class CouchbaseCredentialsApi implements ICredentialType {
|
|
3
3
|
name: string;
|
|
4
4
|
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
5
6
|
properties: INodeProperties[];
|
|
6
|
-
authenticate: IAuthenticateGeneric;
|
|
7
|
-
test: ICredentialTestRequest;
|
|
8
7
|
}
|
|
@@ -3,43 +3,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.CouchbaseCredentialsApi = void 0;
|
|
4
4
|
class CouchbaseCredentialsApi {
|
|
5
5
|
constructor() {
|
|
6
|
-
this.name = '
|
|
7
|
-
this.displayName = '
|
|
6
|
+
this.name = 'couchbaseApi';
|
|
7
|
+
this.displayName = 'Couchbase Credentials API';
|
|
8
|
+
this.documentationUrl = 'https://github.com/maruakinu/n8n-nodes-couchbase.git';
|
|
8
9
|
this.properties = [
|
|
9
10
|
{
|
|
10
|
-
displayName: '
|
|
11
|
-
name: '
|
|
11
|
+
displayName: 'Connection String',
|
|
12
|
+
name: 'MyConnection',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: '',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
displayName: 'Username',
|
|
18
|
+
name: 'MyUsername',
|
|
12
19
|
type: 'string',
|
|
13
20
|
default: '',
|
|
14
21
|
},
|
|
15
22
|
{
|
|
16
23
|
displayName: 'Password',
|
|
17
|
-
name: '
|
|
24
|
+
name: 'MyPassword',
|
|
18
25
|
type: 'string',
|
|
19
|
-
typeOptions: {
|
|
20
|
-
password: true,
|
|
21
|
-
},
|
|
22
26
|
default: '',
|
|
23
27
|
},
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
username: '={{ $credentials.username }}',
|
|
30
|
-
password: '={{ $credentials.password }}',
|
|
31
|
-
},
|
|
32
|
-
qs: {
|
|
33
|
-
n8n: 'rocks',
|
|
34
|
-
},
|
|
28
|
+
{
|
|
29
|
+
displayName: 'Bucket',
|
|
30
|
+
name: 'MyBucket',
|
|
31
|
+
type: 'string',
|
|
32
|
+
default: '',
|
|
35
33
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
{
|
|
35
|
+
displayName: 'Scope',
|
|
36
|
+
name: 'MyScope',
|
|
37
|
+
type: 'string',
|
|
38
|
+
default: '',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Collection',
|
|
42
|
+
name: 'MyCollection',
|
|
43
|
+
type: 'string',
|
|
44
|
+
default: '',
|
|
41
45
|
},
|
|
42
|
-
|
|
46
|
+
];
|
|
43
47
|
}
|
|
44
48
|
}
|
|
45
49
|
exports.CouchbaseCredentialsApi = CouchbaseCredentialsApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CouchbaseCredentialsApi.credentials.js","sourceRoot":"","sources":["../../credentials/CouchbaseCredentialsApi.credentials.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"CouchbaseCredentialsApi.credentials.js","sourceRoot":"","sources":["../../credentials/CouchbaseCredentialsApi.credentials.ts"],"names":[],"mappings":";;;AAKA,MAAa,uBAAuB;IAApC;QACC,SAAI,GAAG,cAAc,CAAC;QACtB,gBAAW,GAAG,2BAA2B,CAAC;QAC1C,qBAAgB,GAAG,sDAAsD,CAAC;QAC1E,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,mBAAmB;gBAChC,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,UAAU;gBACvB,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE,QAAQ;gBAId,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,SAAS;gBACf,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;YACD;gBACC,WAAW,EAAE,YAAY;gBACzB,IAAI,EAAE,cAAc;gBACpB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACX;SACD,CAAC;IAQH,CAAC;CAAA;AApDD,0DAoDC"}
|
|
@@ -7,7 +7,7 @@ class CouchbaseNode {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
this.description = {
|
|
9
9
|
displayName: 'Couchbase',
|
|
10
|
-
name: '
|
|
10
|
+
name: 'couchbaseNode',
|
|
11
11
|
icon: 'file:CBLogomark.svg',
|
|
12
12
|
group: ['transform'],
|
|
13
13
|
version: 1,
|
|
@@ -17,6 +17,12 @@ class CouchbaseNode {
|
|
|
17
17
|
},
|
|
18
18
|
inputs: ['main'],
|
|
19
19
|
outputs: ['main'],
|
|
20
|
+
credentials: [
|
|
21
|
+
{
|
|
22
|
+
name: 'couchbaseApi',
|
|
23
|
+
required: false,
|
|
24
|
+
},
|
|
25
|
+
],
|
|
20
26
|
properties: [
|
|
21
27
|
{
|
|
22
28
|
displayName: 'Operation',
|
|
@@ -25,10 +31,16 @@ class CouchbaseNode {
|
|
|
25
31
|
noDataExpression: true,
|
|
26
32
|
options: [
|
|
27
33
|
{
|
|
28
|
-
name: '
|
|
34
|
+
name: 'Create',
|
|
29
35
|
value: 'insert',
|
|
30
|
-
description: '
|
|
31
|
-
action: '
|
|
36
|
+
description: 'Create document in couchbase',
|
|
37
|
+
action: 'Create document in couchbase',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'Read',
|
|
41
|
+
value: 'find',
|
|
42
|
+
description: 'Read document in couchbase',
|
|
43
|
+
action: 'Read document in couchbase',
|
|
32
44
|
},
|
|
33
45
|
{
|
|
34
46
|
name: 'Update',
|
|
@@ -37,86 +49,34 @@ class CouchbaseNode {
|
|
|
37
49
|
action: 'Update document in couchbase',
|
|
38
50
|
},
|
|
39
51
|
{
|
|
40
|
-
name: '
|
|
52
|
+
name: 'Delete',
|
|
41
53
|
value: 'remove',
|
|
42
|
-
description: '
|
|
43
|
-
action: '
|
|
54
|
+
description: 'Delete document in couchbase',
|
|
55
|
+
action: 'Delete document in couchbase',
|
|
44
56
|
},
|
|
45
57
|
],
|
|
46
58
|
default: 'insert',
|
|
47
59
|
},
|
|
48
60
|
{
|
|
49
|
-
displayName: '
|
|
50
|
-
name: '
|
|
51
|
-
type: 'string',
|
|
52
|
-
displayOptions: {
|
|
53
|
-
show: {
|
|
54
|
-
operation: ['insert', 'update', 'remove'],
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
default: '',
|
|
58
|
-
placeholder: 'Enter Your Username',
|
|
59
|
-
description: 'The description text',
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
displayName: 'Password',
|
|
63
|
-
name: 'myPassword',
|
|
64
|
-
type: 'string',
|
|
65
|
-
displayOptions: {
|
|
66
|
-
show: {
|
|
67
|
-
operation: ['insert', 'update', 'remove'],
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
default: '',
|
|
71
|
-
placeholder: 'Enter Your Password',
|
|
72
|
-
description: 'The description text',
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
displayName: 'Bucket',
|
|
76
|
-
name: 'myBucket',
|
|
77
|
-
type: 'string',
|
|
78
|
-
displayOptions: {
|
|
79
|
-
show: {
|
|
80
|
-
operation: ['insert', 'update', 'remove'],
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
default: '',
|
|
84
|
-
placeholder: 'Enter Bucket Name',
|
|
85
|
-
description: 'The description text',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
displayName: 'Scope',
|
|
89
|
-
name: 'myScope',
|
|
90
|
-
type: 'string',
|
|
91
|
-
displayOptions: {
|
|
92
|
-
show: {
|
|
93
|
-
operation: ['insert', 'update', 'remove'],
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
default: '',
|
|
97
|
-
placeholder: 'Enter Scope Name',
|
|
98
|
-
description: 'The description text',
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
displayName: 'Colection',
|
|
102
|
-
name: 'myCollection',
|
|
61
|
+
displayName: 'Value',
|
|
62
|
+
name: 'myDocument',
|
|
103
63
|
type: 'string',
|
|
104
64
|
displayOptions: {
|
|
105
65
|
show: {
|
|
106
|
-
operation: ['insert'
|
|
66
|
+
operation: ['insert'],
|
|
107
67
|
},
|
|
108
68
|
},
|
|
109
69
|
default: '',
|
|
110
|
-
placeholder: '
|
|
70
|
+
placeholder: 'Placeholder value',
|
|
111
71
|
description: 'The description text',
|
|
112
72
|
},
|
|
113
73
|
{
|
|
114
|
-
displayName: '
|
|
74
|
+
displayName: 'Document ID',
|
|
115
75
|
name: 'myDocument',
|
|
116
76
|
type: 'string',
|
|
117
77
|
displayOptions: {
|
|
118
78
|
show: {
|
|
119
|
-
operation: ['
|
|
79
|
+
operation: ['update'],
|
|
120
80
|
},
|
|
121
81
|
},
|
|
122
82
|
default: '',
|
|
@@ -124,8 +84,8 @@ class CouchbaseNode {
|
|
|
124
84
|
description: 'The description text',
|
|
125
85
|
},
|
|
126
86
|
{
|
|
127
|
-
displayName: '
|
|
128
|
-
name: '
|
|
87
|
+
displayName: 'Value',
|
|
88
|
+
name: 'myValue',
|
|
129
89
|
type: 'string',
|
|
130
90
|
displayOptions: {
|
|
131
91
|
show: {
|
|
@@ -137,12 +97,12 @@ class CouchbaseNode {
|
|
|
137
97
|
description: 'The description text',
|
|
138
98
|
},
|
|
139
99
|
{
|
|
140
|
-
displayName: '
|
|
141
|
-
name: '
|
|
100
|
+
displayName: 'Document ID',
|
|
101
|
+
name: 'myDocument',
|
|
142
102
|
type: 'string',
|
|
143
103
|
displayOptions: {
|
|
144
104
|
show: {
|
|
145
|
-
operation: ['
|
|
105
|
+
operation: ['remove'],
|
|
146
106
|
},
|
|
147
107
|
},
|
|
148
108
|
default: '',
|
|
@@ -150,12 +110,12 @@ class CouchbaseNode {
|
|
|
150
110
|
description: 'The description text',
|
|
151
111
|
},
|
|
152
112
|
{
|
|
153
|
-
displayName: 'ID',
|
|
113
|
+
displayName: 'Document ID',
|
|
154
114
|
name: 'myDocument',
|
|
155
115
|
type: 'string',
|
|
156
116
|
displayOptions: {
|
|
157
117
|
show: {
|
|
158
|
-
operation: ['
|
|
118
|
+
operation: ['find'],
|
|
159
119
|
},
|
|
160
120
|
},
|
|
161
121
|
default: '',
|
|
@@ -166,41 +126,42 @@ class CouchbaseNode {
|
|
|
166
126
|
};
|
|
167
127
|
}
|
|
168
128
|
async execute() {
|
|
129
|
+
const credentials = await this.getCredentials('couchbaseApi');
|
|
130
|
+
const myConnection = credentials.MyConnection;
|
|
131
|
+
const myUsername = credentials.MyUsername;
|
|
132
|
+
const myPassword = credentials.MyPassword;
|
|
133
|
+
const myBucket = credentials.MyBucket;
|
|
134
|
+
const myScope = credentials.MyScope;
|
|
135
|
+
const myCollection = credentials.MyCollection;
|
|
169
136
|
const items = this.getInputData();
|
|
170
137
|
let item;
|
|
171
138
|
let item2;
|
|
139
|
+
let item3;
|
|
140
|
+
let item4;
|
|
172
141
|
let myDocument;
|
|
173
142
|
let myNewValue;
|
|
174
|
-
let
|
|
175
|
-
let myPassword;
|
|
176
|
-
let myBucket;
|
|
177
|
-
let myScope;
|
|
178
|
-
let myCollection;
|
|
143
|
+
let readJson;
|
|
179
144
|
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
|
180
145
|
try {
|
|
181
146
|
myNewValue = this.getNodeParameter('myValue', itemIndex, '');
|
|
182
147
|
myDocument = this.getNodeParameter('myDocument', itemIndex, '');
|
|
183
|
-
|
|
184
|
-
myPassword = this.getNodeParameter('myPassword', itemIndex, '');
|
|
185
|
-
myBucket = this.getNodeParameter('myBucket', itemIndex, '');
|
|
186
|
-
myScope = this.getNodeParameter('myScope', itemIndex, '');
|
|
187
|
-
myCollection = this.getNodeParameter('myCollection', itemIndex, '');
|
|
188
|
-
const clusterConnStr = "couchbase://127.0.0.1/?connectionTimeout=1200";
|
|
148
|
+
const clusterConnStr = myConnection;
|
|
189
149
|
const username = myUsername;
|
|
190
150
|
const password = myPassword;
|
|
191
151
|
const bucketName = myBucket;
|
|
192
152
|
const cluster = await (0, couchbase_1.connect)(clusterConnStr, {
|
|
193
153
|
username: username,
|
|
194
154
|
password: password,
|
|
155
|
+
configProfile: 'wanDevelopment'
|
|
195
156
|
});
|
|
196
157
|
const bucket = cluster.bucket(bucketName);
|
|
197
158
|
const collection = bucket
|
|
198
159
|
.scope(myScope)
|
|
199
160
|
.collection(myCollection);
|
|
200
|
-
item = items[itemIndex];
|
|
201
|
-
item.json['myDocument'] = myDocument;
|
|
202
161
|
const operation = this.getNodeParameter('operation', 0);
|
|
203
162
|
if (operation === 'insert') {
|
|
163
|
+
item = items[itemIndex];
|
|
164
|
+
item.json['myDocument'] = myDocument;
|
|
204
165
|
await collection.insert(myDocument, item.json);
|
|
205
166
|
}
|
|
206
167
|
else if (operation === 'update') {
|
|
@@ -211,6 +172,17 @@ class CouchbaseNode {
|
|
|
211
172
|
else if (operation === 'remove') {
|
|
212
173
|
await collection.remove(myDocument);
|
|
213
174
|
}
|
|
175
|
+
else if (operation === 'find') {
|
|
176
|
+
const getResult = await collection.get(myDocument);
|
|
177
|
+
console.log('Get Result:', getResult);
|
|
178
|
+
readJson = JSON.stringify(getResult.content);
|
|
179
|
+
console.log('Get Result in String:', readJson);
|
|
180
|
+
item3 = items[itemIndex];
|
|
181
|
+
item3.json[''] = readJson;
|
|
182
|
+
item4 = items[itemIndex];
|
|
183
|
+
item4.json[' '];
|
|
184
|
+
await collection.get(myDocument);
|
|
185
|
+
}
|
|
214
186
|
}
|
|
215
187
|
catch (error) {
|
|
216
188
|
if (this.continueOnFail()) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CouchbaseNode.node.js","sourceRoot":"","sources":["../../../nodes/CouchbaseDB/CouchbaseNode.node.ts"],"names":[],"mappings":";;;AACA,+CAKsB;AAEtB,yCAKoB;AAEpB,MAAa,aAAa;IAA1B;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,WAAW;YACxB,IAAI,EAAE,eAAe;YACrB,IAAI,EAAE,qBAAqB;YAC3B,KAAK,EAAE,CAAC,WAAW,CA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