Why not simply replace the $resource array with the `MongoClient` instance ?