Import MongoInternals in Meteor+React

I need to connect external MongoDb database

my code
/imports/api/Connection.js

import { MongoInternals } from 'meteor/mongo'; // i am probably wrong here!!
import CONST from './Constants.js';

let Connection = new MongoInternals.RemoteCollectionDriver(CONST.mongo);
export {Connection};

/imports/api/ABC.js

import {Connection} from './Connection.js';
let ABC = new Mongo.Collection('abc', {
    _driver: Connection
});
export {
    ABC
};

It return MongoInternals not defined i didn’t find any where from where to import MongoInternals
Please help me to find solution
Thank you

MongoInternals is exported here:

So, you do need to import { MongoInternals } from 'meteor/mongo';. However, it’s only available on the server - did you maybe try to import it on the client?

1 Like