Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// Stellarium Web - Copyright (c) 2018 - Noctua Software Ltd
//
// This program is licensed under the terms of the GNU AGPL v3, or
// alternatively under a commercial licence.
//
// The terms of the AGPL v3 license can be found in the main directory of this
// repository.
import Swagger from 'swagger-client'
import _ from 'lodash'
import store from 'store'
import mingo from 'mingo'
mingo.setup({key: 'id'})
var swaggerClient
var localIdCounter = 0
var generateLocalId = function () {
localIdCounter++
return 'local_' + localIdCounter
}
var equipments = [
{
id: 'none'
},
{
id: 'base',
schema: [
const search = (searchData, params) => {
const tableSettings = JSON.parse(params.get('tableSettings'));
const limit = params.get('limit');
const offset = params.get('offset');
const searchValue = params.get('searchValue');
const columnFilters = JSON.parse(params.get('columnFilters'));
mingo.setup({
key: tableSettings.keyField
});
const searchableColumns = tableSettings.tableColumns
.filter(column => column.searchable !== false)
.map(column => column.key);
const searchValueQuery = generateSearchValueQuery(searchValue, searchableColumns);
const filterQuery = generateFilterQuery(columnFilters);
const sortOptions = generateSortOptions(tableSettings, params);
const query = {...searchValueQuery, ...filterQuery};
const dataTotalSize = mingo
.find(searchData.data, query)
.count();
const data = mingo
module.exports = function(opts) {
var options = Object.assign({ idProperty: '_id' }, opts)
var self = es.map(createOrUpdate)
var data = []
var idSeq = 0
Mingo.setup({ key: options.idProperty })
function findById(id) {
var query = {}
query[options.idProperty] = id
return Mingo.find(data, query).first()
}
/**
* Checks that the object has the ID property present, then checks
* if the data object has that ID value present.e
*
* Returns an Error to the callback if either of the above checks fail
*
* @param {Object} object to check
* @param {Function} callback
* @api private
import Mingo from 'mingo'
Mingo.setup({
key: '_id'
})
const metaOperators = {
$comment: true,
$explain: true,
$hint: true,
$limit: true,
$maxScan: true,
$max: true,
$min: true,
$orderby: true,
$returnKey: true,
$showDiskLoc: true,
$skip: true,
$snapshot: true,