Skip to content

Commit dc64cc9

Browse files
committed
closes #22
1 parent dce0ece commit dc64cc9

File tree

13 files changed

+235
-185
lines changed

13 files changed

+235
-185
lines changed

19/blog/blog-backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"koa": "^2.5.1",
1010
"koa-bodyparser": "^4.2.1",
1111
"koa-router": "^7.4.0",
12-
"mongoose": "^5.1.2"
12+
"mongoose": "^5.2.12"
1313
},
1414
"devDependencies": {
1515
"eslint": "^4.19.1",

19/blog/blog-backend/src/api/posts/posts.ctrl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ exports.list = async (ctx) => {
7777
.skip((page - 1) * 10)
7878
.lean()
7979
.exec();
80-
const postCount = await Post.count().exec();
80+
const postCount = await Post.countDocuments().exec();
8181
const limitBodyLength = post => ({
8282
...post,
8383
body: post.body.length < 200 ? post.body : `${post.body.slice(0, 200)}...`

19/blog/blog-backend/yarn.lock

Lines changed: 55 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ arrify@^1.0.0:
8282
version "1.0.1"
8383
resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d"
8484

85-
async@2.1.4:
86-
version "2.1.4"
87-
resolved "https://registry.yarnpkg.com/async/-/async-2.%3Cspan%20class="x x-first x-last">1.4.tgz#2d2160c7788032e4dd6cbe2502f1f9a2c8f6cde4"
85+
async@2.6.1:
86+
version "2.6.1"
87+
resolved "https://registry.yarnpkg.com/async/-/async-2.%3Cspan%20class="x x-first x-last">6.1.tgz#b245a23ca71930044ec53fa46aa00a3e87c6a610"
8888
dependencies:
89-
lodash "^4.14.0"
89+
lodash "^4.17.10"
9090

9191
babel-code-frame@^6.22.0:
9292
version "6.26.0"
@@ -100,9 +100,9 @@ balanced-match@^1.0.0:
100100
version "1.0.0"
101101
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
102102

103-
104-
version "3.5.0"
105-
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.%3Cspan%20class="x x-first x-last">0.tgz#791420d7f551eea2897453a8a77653f96606d67c"
103+
104+
version "3.5.1"
105+
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.5.%3Cspan%20class="x x-first x-last">1.tgz#d9551f9de98f1fcda1e683d17ee91a0602ee2eb9"
106106

107107
brace-expansion@^1.1.7:
108108
version "1.1.11"
@@ -111,7 +111,11 @@ brace-expansion@^1.1.7:
111111
balanced-match "^1.0.0"
112112
concat-map "0.0.1"
113113

114-
bson@~1.0.4, bson@~1.0.5:
114+
bson@^1.1.0:
115+
version "1.1.0"
116+
resolved "https://registry.yarnpkg.com/bson/-/bson-1.1.0.tgz#bee57d1fb6a87713471af4e32bcae36de814b5b0"
117+
118+
bson@~1.0.5:
115119
version "1.0.6"
116120
resolved "https://registry.yarnpkg.com/bson/-/bson-1.0.6.tgz#444db59ddd4c24f0cb063aabdc5c8c7b0ceca912"
117121

@@ -244,13 +248,13 @@ cross-spawn@^5.1.0:
244248
shebang-command "^1.2.0"
245249
which "^1.2.9"
246250

247-
debug@*, debug@^3.1.0:
251+
debug@*, debug@3.1.0, debug@^3.1.0:
248252
version "3.1.0"
249253
resolved "https://registry.yarnpkg.com/debug/-/debug-3.1.0.tgz#5bb5a0672628b64149566ba16819e61518c67261"
250254
dependencies:
251255
ms "2.0.0"
252256

253-
debug@2.6.9, debug@^2.6.8, debug@^2.6.9:
257+
debug@^2.6.8, debug@^2.6.9:
254258
version "2.6.9"
255259
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
256260
dependencies:
@@ -727,9 +731,9 @@ json-stable-stringify-without-jsonify@^1.0.1:
727731
version "1.0.1"
728732
resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651"
729733

730-
kareem@2.1.0:
731-
version "2.1.0"
732-
resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.%3Cspan%20class="x x-first x-last">1.0.tgz#d63197b57311830e4ceb3f34431f22f2de826a03"
734+
kareem@2.2.1:
735+
version "2.2.1"
736+
resolved "https://registry.yarnpkg.com/kareem/-/kareem-2.%3Cspan%20class="x x-first x-last">2.1.tgz#9950809415aa3cde62ab43b4f7b919d99816e015"
733737

734738
keygrip@~1.0.2:
735739
version "1.0.2"
@@ -830,7 +834,7 @@ [email protected]:
830834
version "4.4.2"
831835
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
832836

833-
lodash@^4.14.0, lodash@^4.17.4, lodash@^4.3.0:
837+
lodash@^4.17.10, lodash@^4.17.4, lodash@^4.3.0:
834838
version "4.17.10"
835839
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"
836840

@@ -879,51 +883,58 @@ mkdirp@^0.5.1:
879883
dependencies:
880884
minimist "0.0.8"
881885

882-
mongodb-core@3.0.8:
883-
version "3.0.8"
884-
resolved "https://registry.yarnpkg.com/mongodb-core/-/mongodb-core-3.%3Cspan%20class="x x-first x-last">0.8.tgz#8d401f4eab6056c0d874a3d5844a4844f761d4d7"
886+
mongodb-core@3.1.3:
887+
version "3.1.3"
888+
resolved "https://registry.yarnpkg.com/mongodb-core/-/mongodb-core-3.%3Cspan%20class="x x-first x-last">1.3.tgz#b036bce5290b383fe507238965bef748dd8adb75"
885889
dependencies:
886-
bson "~1.0.4"
890+
bson "^1.1.0"
887891
require_optional "^1.0.1"
892+
safe-buffer "^5.1.2"
893+
optionalDependencies:
894+
saslprep "^1.0.0"
888895

889-
mongodb@3.0.8:
890-
version "3.0.8"
891-
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.%3Cspan%20class="x x-first x-last">0.8.tgz#2c1daecac9a0ec2de2f2aea4dc97d76ae70f8951"
896+
mongodb@3.1.4:
897+
version "3.1.4"
898+
resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.%3Cspan%20class="x x-first x-last">1.4.tgz#0ff07a7409a4edf05e71f9ff8df3633bd278ed53"
892899
dependencies:
893-
mongodb-core "3.0.8"
900+
mongodb-core "3.1.3"
901+
safe-buffer "^5.1.2"
894902

895903
896904
version "1.0.2"
897905
resolved "https://registry.yarnpkg.com/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz#3ba9f91fa507b5186d399fb40854bff18fb563e4"
898906

899-
mongoose@^5.1.2:
900-
version "5.1.2"
901-
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.%3Cspan%20class="x x-first x-last">1.2.tgz#f0cf29f8e5b43b7ec0abb279f831b9ddfd266380"
907+
mongoose@^5.2.12:
908+
version "5.2.12"
909+
resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.%3Cspan%20class="x x-first x-last">2.12.tgz#b8eda7947fe9b2b9b2decac01c0afed5e59dbcb5"
902910
dependencies:
903-
async "2.1.4"
911+
async "2.6.1"
904912
bson "~1.0.5"
905-
kareem "2.1.0"
913+
kareem "2.2.1"
906914
lodash.get "4.4.2"
907-
mongodb "3.0.8"
915+
mongodb "3.1.4"
916+
mongodb-core "3.1.3"
908917
mongoose-legacy-pluralize "1.0.2"
909-
mpath "0.4.1"
910-
mquery "3.0.0"
918+
mpath "0.5.1"
919+
mquery "3.2.0"
911920
ms "2.0.0"
912921
regexp-clone "0.0.1"
922+
safe-buffer "5.1.2"
913923
sliced "1.0.1"
914924

915-
mpath@0.4.1:
916-
version "0.4.1"
917-
resolved "https://registry.yarnpkg.com/mpath/-/mpath-0.%3Cspan%20class="x x-first x-last">4.1.tgz#ed10388430380bf7bbb5be1391e5d6969cb08e89"
925+
mpath@0.5.1:
926+
version "0.5.1"
927+
resolved "https://registry.yarnpkg.com/mpath/-/mpath-0.%3Cspan%20class="x x-first x-last">5.1.tgz#17131501f1ff9e6e4fbc8ffa875aa7065b5775ab"
918928

919-
mquery@3.0.0:
920-
version "3.0.0"
921-
resolved "https://registry.yarnpkg.com/mquery/-/mquery-3.%3Cspan%20class="x x-first x-last">0.0.tgz#e5f387dbabc0b9b69859e550e810faabe0ceabb0"
929+
mquery@3.2.0:
930+
version "3.2.0"
931+
resolved "https://registry.yarnpkg.com/mquery/-/mquery-3.%3Cspan%20class="x x-first x-last">2.0.tgz#e276472abd5109686a15eb2a8e0761db813c81cc"
922932
dependencies:
923-
bluebird "3.5.0"
924-
debug "2.6.9"
933+
bluebird "3.5.1"
934+
debug "3.1.0"
925935
regexp-clone "0.0.1"
926-
sliced "0.0.5"
936+
safe-buffer "5.1.2"
937+
sliced "1.0.1"
927938

928939
929940
version "2.0.0"
@@ -1200,14 +1211,18 @@ rx-lite@*, rx-lite@^4.0.8:
12001211
version "4.0.8"
12011212
resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444"
12021213

1203-
safe-buffer@~5.1.0, safe-buffer@~5.1.1:
1214+
safe-buffer@5.1.2, safe-buffer@^5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
12041215
version "5.1.2"
12051216
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
12061217

12071218
"safer-buffer@>= 2.1.2 < 3":
12081219
version "2.1.2"
12091220
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
12101221

1222+
saslprep@^1.0.0:
1223+
version "1.0.1"
1224+
resolved "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.1.tgz#b644e0ba25b156b652f3cb90df7542f896049ba6"
1225+
12111226
"semver@2 || 3 || 4 || 5", semver@^5.1.0, semver@^5.3.0:
12121227
version "5.5.0"
12131228
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
@@ -1236,10 +1251,6 @@ [email protected]:
12361251
dependencies:
12371252
is-fullwidth-code-point "^2.0.0"
12381253

1239-
1240-
version "0.0.5"
1241-
resolved "https://registry.yarnpkg.com/sliced/-/sliced-0.0.5.tgz#5edc044ca4eb6f7816d50ba2fc63e25d8fe4707f"
1242-
12431254
12441255
version "1.0.1"
12451256
resolved "https://registry.yarnpkg.com/sliced/-/sliced-1.0.1.tgz#0b3a662b5d04c3177b1926bea82b03f837a2ef41"

20/blog/blog-backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"koa": "^2.5.1",
1010
"koa-bodyparser": "^4.2.1",
1111
"koa-router": "^7.4.0",
12-
"mongoose": "^5.1.2"
12+
"mongoose": "^5.2.12"
1313
},
1414
"devDependencies": {
1515
"eslint": "^4.19.1",

20/blog/blog-backend/src/api/posts/posts.ctrl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ exports.list = async (ctx) => {
7777
.skip((page - 1) * 10)
7878
.lean()
7979
.exec();
80-
const postCount = await Post.count().exec();
80+
const postCount = await Post.countDocuments().exec();
8181
const limitBodyLength = post => ({
8282
...post,
8383
body: post.body.length < 200 ? post.body : `${post.body.slice(0, 200)}...`

0 commit comments

Comments
 (0)