File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
3
4
+ ##### 1.0.0 (2015-06-29)
5
+ - Fix delete no-op.
6
+ - Fix create no-op.
7
+ - Fix sort input.
8
+
9
+
4
10
##### 1.0.0-alpha.10 (2015-06-18)
5
11
- Bump dependency versions.
6
12
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ export default Adapter => class MongodbAdapter extends Adapter {
79
79
const find = this . db . collection ( type ) . find ( ...args )
80
80
81
81
if ( 'sort' in options )
82
- find . sort ( options . sort )
82
+ find . sort ( mapValues ( options . sort , value => value ? 1 : - 1 ) )
83
83
84
84
if ( 'offset' in options )
85
85
find . skip ( options . offset )
@@ -105,6 +105,8 @@ export default Adapter => class MongodbAdapter extends Adapter {
105
105
106
106
107
107
create ( type , records ) {
108
+ if ( ! records . length ) return super . create ( )
109
+
108
110
const { errors } = this
109
111
110
112
return new Promise ( ( resolve , reject ) =>
@@ -151,6 +153,8 @@ export default Adapter => class MongodbAdapter extends Adapter {
151
153
152
154
153
155
delete ( type , ids ) {
156
+ if ( ids && ! ids . length ) return super . delete ( )
157
+
154
158
return new Promise ( ( resolve , reject ) =>
155
159
this . db . collection ( type ) . remove ( ids && ids . length ?
156
160
{ [ idKey ] : { $in : ids } } : { } , { multi : true } ,
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " fortune-mongodb" ,
3
3
"description" : " MongoDB adapter for Fortune." ,
4
- "version" : " 1.0.0-alpha.11 " ,
4
+ "version" : " 1.0.0" ,
5
5
"license" : " MIT" ,
6
6
"author" : {
7
7
20
20
},
21
21
"main" : " ./dist/index.js" ,
22
22
"dependencies" : {
23
- "babel-runtime" : " 5.6.4 " ,
23
+ "babel-runtime" : " 5.6.15 " ,
24
24
"mongodb" : " 2.0.35"
25
25
},
26
26
"devDependencies" : {
27
- "babel" : " 5.6.4 " ,
28
- "eslint" : " 0.23 .0" ,
29
- "fortune" : " >=1.0.0-alpha.12 " ,
27
+ "babel" : " 5.6.14 " ,
28
+ "eslint" : " 0.24 .0" ,
29
+ "fortune" : " >=1.0.0-beta.1 " ,
30
30
"mkdirp" : " 0.5.1" ,
31
31
"rimraf" : " 2.4.0" ,
32
32
"tap-dot" : " 1.0.0"
You can’t perform that action at this time.
0 commit comments