File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change 1010import { MongoClient , GridFSBucket , Db } from 'mongodb' ;
1111import { FilesAdapter , validateFilename } from './FilesAdapter' ;
1212import defaults , { ParseServerDatabaseOptions } from '../../defaults' ;
13+ import { version } from '../../../package.json' ;
1314const crypto = require ( 'crypto' ) ;
1415
1516export class GridFSBucketAdapter extends FilesAdapter {
@@ -48,6 +49,7 @@ export class GridFSBucketAdapter extends FilesAdapter {
4849 this . _connectionPromise = MongoClient . connect ( this . _databaseURI , this . _mongoOptions ) . then (
4950 client => {
5051 this . _client = client ;
52+ client . appendMetadata ( { name : 'parse_server_gridfs' , version : version } ) ;
5153 return client . db ( client . s . options . dbName ) ;
5254 }
5355 ) ;
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import _ from 'lodash';
1919import defaults , { ParseServerDatabaseOptions } from '../../../defaults' ;
2020import logger from '../../../logger' ;
2121import Utils from '../../../Utils' ;
22+ import { version } from '../../../../package.json' ;
2223
2324// @flow -disable-next
2425const mongodb = require ( 'mongodb' ) ;
@@ -184,6 +185,7 @@ export class MongoStorageAdapter implements StorageAdapter {
184185 // Starting mongoDB 3.0, the MongoClient.connect don't return a DB anymore but a client
185186 // Fortunately, we can get back the options and use them to select the proper DB.
186187 // https://github.com/mongodb/node-mongodb-native/blob/2c35d76f08574225b8db02d7bef687123e6bb018/lib/mongo_client.js#L885
188+ client . appendMetadata ( { name : 'parse_server_storage' , version : version } ) ;
187189 const options = client . s . options ;
188190 const database = client . db ( options . dbName ) ;
189191 if ( ! database ) {
You can’t perform that action at this time.
0 commit comments