diff --git a/types/mongoose-simple-random/index.d.ts b/types/mongoose-simple-random/index.d.ts
index deed6a036f..a57f366df2 100644
--- a/types/mongoose-simple-random/index.d.ts
+++ b/types/mongoose-simple-random/index.d.ts
@@ -4,6 +4,12 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///
+declare module 'mongoose-simple-random' {
+ import mongoose = require('mongoose');
+ var _: (schema: mongoose.Schema) => void;
+ export = _;
+}
+
declare module "mongoose" {
interface Model extends NodeJS.EventEmitter, ModelProperties {
findRandom(conditions: Object, projection?: Object | null, options?: Object | null, callback?: (err: any, res: T[]) => void)
diff --git a/types/mongoose-simple-random/mongoose-simple-random-tests.ts b/types/mongoose-simple-random/mongoose-simple-random-tests.ts
index 2aa9e18296..f5b26dbebb 100644
--- a/types/mongoose-simple-random/mongoose-simple-random-tests.ts
+++ b/types/mongoose-simple-random/mongoose-simple-random-tests.ts
@@ -1,4 +1,5 @@
import * as mongoose from 'mongoose';
+import * as mongoose_simple_random from "mongoose-simple-random";
// test compatibility with other libraries - from @types/mongoose
import * as _ from 'lodash';
@@ -13,3 +14,5 @@ mongoose.Model.findRandom({
}, {}, { limit: 1 }, (error, data) => {
if (error) { console.error("Error!"); } else { console.log("Success!"); }
});
+
+mongoose.plugin(mongoose_simple_random);