Files
Tempest/server/DataCollection.js

17 lines
634 B
JavaScript
Raw Normal View History

import {MongoInternals} from 'meteor/mongo';
import {Meteor} from 'meteor/meteor';
console.log("Setting up data collection database connection...");
let uri = process.env.MONGO_URL2; //"mongodb://localhost:27017/avusd_data_collection";
//uri = "mongodb://localhost:27017/avusd_data_collection";
//console.log(uri);
let db2 = new MongoInternals.RemoteCollectionDriver(uri);
let collection = new Mongo.Collection("records", {_driver: db2});
Meteor.Records = collection;
// let results = collection.find({deviceId: "1e3e99ef-adf4-4aa2-8784-205bc60f0ce3"}).fetch();
// console.log(results);
console.log("Database connection setup.")