File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed
server/object_services/schemas Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,22 @@ module.exports = [{
15
15
}
16
16
}
17
17
} ,
18
+ {
19
+ fields : {
20
+ _id : 1 ,
21
+ } ,
22
+ options : {
23
+ unique : false ,
24
+ // mongo does not support partial indexes on _id field
25
+ // This is a workaround to exclude it for mongo for tests purposes
26
+ postgres_only : true ,
27
+ name : "deleted_not_reclaimed" ,
28
+ partialFilterExpression : {
29
+ deleted : { $exists : true } ,
30
+ reclaimed : { $exists : false }
31
+ }
32
+ }
33
+ } ,
18
34
{
19
35
// iterate_node_chunks()
20
36
// count_blocks_of_node()
Original file line number Diff line number Diff line change @@ -33,9 +33,8 @@ class MongoCollection {
33
33
MongoCollection . implements_interface ( this ) ;
34
34
this . schema = col . schema ;
35
35
this . name = col . name ;
36
- this . db_indexes = col . db_indexes ;
36
+ this . db_indexes = col . db_indexes ?. filter ( index => ! index ?. options ?. postgres_only ) ;
37
37
this . mongo_client = mongo_client ;
38
-
39
38
}
40
39
41
40
/**
@@ -46,9 +45,9 @@ class MongoCollection {
46
45
}
47
46
48
47
/**
49
- *
50
- * @param {object } doc
51
- * @param {'warn' } [warn]
48
+ *
49
+ * @param {object } doc
50
+ * @param {'warn' } [warn]
52
51
*/
53
52
validate ( doc , warn ) {
54
53
if ( this . schema ) {
@@ -553,7 +552,7 @@ class MongoClient extends EventEmitter {
553
552
}
554
553
555
554
/**
556
- *
555
+ *
557
556
* @returns {nb.DBCollection }
558
557
*/
559
558
define_collection ( col ) {
@@ -585,7 +584,7 @@ class MongoClient extends EventEmitter {
585
584
}
586
585
587
586
/**
588
- *
587
+ *
589
588
* @returns {nb.DBCollection }
590
589
*/
591
590
collection ( col_name ) {
You can’t perform that action at this time.
0 commit comments