@@ -108,6 +108,9 @@ usersApi.update = function(app_id, query, update, params, callback) {
108
108
callback = params ;
109
109
params = { } ;
110
110
}
111
+ plugins . dispatch ( "/drill/preprocess_query" , {
112
+ query : query
113
+ } ) ;
111
114
if ( Object . keys ( update ) . length ) {
112
115
for ( var i in update ) {
113
116
if ( i . indexOf ( "$" ) !== 0 ) {
@@ -152,6 +155,9 @@ usersApi.delete = function(app_id, query, params, callback) {
152
155
callback = params ;
153
156
params = { } ;
154
157
}
158
+ plugins . dispatch ( "/drill/preprocess_query" , {
159
+ query : query
160
+ } ) ;
155
161
common . db . collection ( "app_users" + app_id ) . aggregate ( [
156
162
{ $match : query } ,
157
163
{
@@ -238,6 +244,10 @@ usersApi.search = function(app_id, query, project, sort, limit, skip, callback)
238
244
}
239
245
}
240
246
247
+ plugins . dispatch ( "/drill/preprocess_query" , {
248
+ query : query
249
+ } ) ;
250
+
241
251
project = project || { } ;
242
252
if ( typeof project === "string" && project . length ) {
243
253
try {
@@ -294,6 +304,10 @@ usersApi.count = function(app_id, query, callback) {
294
304
}
295
305
}
296
306
307
+ plugins . dispatch ( "/drill/preprocess_query" , {
308
+ query : query
309
+ } ) ;
310
+
297
311
common . db . collection ( 'app_users' + app_id ) . find ( query ) . count ( callback ) ;
298
312
} ;
299
313
@@ -704,6 +718,11 @@ usersApi.export = function(app_id, query, params, callback) {
704
718
}
705
719
} ) ;
706
720
}
721
+
722
+ plugins . dispatch ( "/drill/preprocess_query" , {
723
+ query : query
724
+ } ) ;
725
+
707
726
common . db . collection ( "app_users" + app_id ) . aggregate ( [
708
727
{ $match : query } ,
709
728
{
@@ -817,10 +836,10 @@ usersApi.export = function(app_id, query, params, callback) {
817
836
}
818
837
} ) . then ( function ( ) {
819
838
//export data from metric_changes
820
- return run_command ( 'mongoexport' , [ ...dbargs , "--collection" , "metric_changes" + app_id , "-q" , '{uid:{ $in: ["' + res [ 0 ] . uid . join ( '","' ) + '"]}}' , "--out" , export_folder + "/metric_changes" + app_id + ".json" ] ) ;
839
+ return run_command ( 'mongoexport' , [ ...dbargs , "--collection" , "metric_changes" + app_id , "-q" , '{" uid":{" $in" : ["' + res [ 0 ] . uid . join ( '","' ) + '"]}}' , "--out" , export_folder + "/metric_changes" + app_id + ".json" ] ) ;
821
840
} ) . then ( function ( ) {
822
841
//export data from app_users
823
- return run_command ( 'mongoexport' , [ ...dbargs , "--collection" , "app_users" + app_id , "-q" , '{uid:{ $in: ["' + res [ 0 ] . uid . join ( '","' ) + '"]}}' , "--out" , export_folder + "/app_users" + app_id + ".json" ] ) ;
842
+ return run_command ( 'mongoexport' , [ ...dbargs , "--collection" , "app_users" + app_id , "-q" , '{" uid":{" $in" : ["' + res [ 0 ] . uid . join ( '","' ) + '"]}}' , "--out" , export_folder + "/app_users" + app_id + ".json" ] ) ;
824
843
} ) . then (
825
844
function ( ) {
826
845
//get other export commands from other plugins
0 commit comments