Connect to remote collection via DDP

In my server side I need access to a remote collection.

let remote = DDP.connect(url);
let Products = new Mongo.Collection(“Products”, remote);

But the Products collection comes empty. Any idea on how to solve this?

Solved


let database = new MongoInternals.RemoteCollectionDriver("mongodb://XXXXX:XXXX@path");
let Products = new Mongo.Collection("Products", { _driver: database });