-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample.js
More file actions
22 lines (20 loc) · 629 Bytes
/
example.js
File metadata and controls
22 lines (20 loc) · 629 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { getXmlRpcClient } from '../../index.js'
import { envOptions as connectionOptions } from '../connection.js'
const db = getXmlRpcClient(connectionOptions)
const collection = 'foO0o'
db.collections.create(collection)
.then(function (result) {
console.log('created:', result)
return db.collections.describe(collection)
})
.then(function (result) {
console.log('description:', result)
return db.collections.remove(collection)
})
.then(function (result) {
console.log('removed:', result)
return db.collections.remove(collection)
})
.catch(function (e) {
console.log('fail', e)
})