A Node.js library to extract data from the SIN3D database.

rigwild 00ff5af349 Initial commit il y a 4 ans
lib 00ff5af349 Initial commit il y a 4 ans
.editorconfig 00ff5af349 Initial commit il y a 4 ans
.eslintrc.js 00ff5af349 Initial commit il y a 4 ans
.gitignore 00ff5af349 Initial commit il y a 4 ans
LICENSE 00ff5af349 Initial commit il y a 4 ans
README.md 00ff5af349 Initial commit il y a 4 ans
example.js 00ff5af349 Initial commit il y a 4 ans
package.json 00ff5af349 Initial commit il y a 4 ans
yarn.lock 00ff5af349 Initial commit il y a 4 ans

README.md

wepexpe-data-extract

Install

yarn add https://gogs.univ-littoral.fr/Prise3D/webexpe-data-extract.git

Usage

'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()

API

See /lib/db/Data/controller.js#L56-L76.

Every functions should be auto-completable in your editor.