Changeset View
Changeset View
Standalone View
Standalone View
lib/datastore/mongo-api-abstract.js
Show All 15 Lines | datastore.post_start = function() { | ||||
const collections = collection_names.map(name => | const collections = collection_names.map(name => | ||||
app.ChipManager.get_chip("collection", name) | app.ChipManager.get_chip("collection", name) | ||||
); | ); | ||||
return Promise.map(collections, function(collection) { | return Promise.map(collections, function(collection) { | ||||
let indexes = [["sealious_id", 1]]; | let indexes = [["sealious_id", 1]]; | ||||
for (var field_name in collection.fields) { | for (var field_name in collection.fields) { | ||||
indexes.push( | indexes.push( | ||||
Promise.all([ | Promise.all([ | ||||
"body." + field_name, | field_name, | ||||
collection.fields[field_name].has_index(), | collection.fields[field_name].has_index(), | ||||
]) | ]) | ||||
); | ); | ||||
} | } | ||||
const db_collection = _private.db.collection(collection.name); | const db_collection = _private.db.collection(collection.name); | ||||
return Promise.all(indexes) | return Promise.all(indexes) | ||||
.then(function(collection_indexes) { | .then(function(collection_indexes) { | ||||
const all_indexes = collection_indexes | const all_indexes = collection_indexes | ||||
▲ Show 20 Lines • Show All 181 Lines • Show Last 20 Lines |