A Node.js library to extract data from the SIN3D database.
rigwild 2e4fd7c3b4 Initial commit | 5 years ago | |
---|---|---|
lib | 5 years ago | |
.editorconfig | 5 years ago | |
.eslintrc.js | 5 years ago | |
.gitignore | 5 years ago | |
LICENSE | 5 years ago | |
README.md | 5 years ago | |
example.js | 5 years ago | |
package.json | 5 years ago | |
yarn.lock | 5 years ago |
yarn add https://gogs.univ-littoral.fr/Prise3D/webexpe-data-extract.git
'use strict'
const path = require('path')
const { db, utils } = require('webexpe-data-extract')
const setup = async () => {
const connection = await db.connect('mongodb://diran.univ-littoral.fr:27017/webexpe')
const res = await db.Data.findCustom({
msgId: 'EXPERIMENT_DATA'
})
console.log(res)
console.log(`Found ${res.length} documents matching your request.`)
const filePath = path.resolve(__dirname, 'searches', `search-${Date.now()}.json`)
await utils.outputToFile(res, filePath, true)
console.log(`Your search result was saved to ${filePath}`)
await db.disconnect(connection)
}
setup()
See /lib/db/Data/controller.js#L56-L76
.
Every functions should be auto-completable in your editor.