├── .gitignore ├── CHANGELOG.md ├── README.md ├── analysis_options.yaml ├── bin └── main.dart ├── lib ├── dart_mongo.dart └── src │ └── people_controller.dart ├── people.json ├── pubspec.yaml └── test └── dart_mongo_test.dart /.gitignore: -------------------------------------------------------------------------------- 1 | # Files and directories created by pub 2 | .dart_tool/ 3 | .packages 4 | # Remove the following pattern if you wish to check in your lock file 5 | pubspec.lock 6 | 7 | # Conventional directory for build outputs 8 | build/ 9 | 10 | # Directory created by dartdoc 11 | doc/api/ 12 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 1.0.0 2 | 3 | - Initial version, created by Stagehand 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dart and MongoDB 2 | 3 | This projects demonstrates how to talk to a MongoDB database. 4 | 5 | ## Download and Install MongoDB 6 | 7 | Visit [https://docs.mongodb.com/manual/administration/install-community/](https://docs.mongodb.com/manual/administration/install-community/) and select your OS for instructions. 8 | 9 | ## Upload json dataset into database 10 | 11 | 1. Start your MongoDB server 12 | 13 | ```bash 14 | mongod 15 | ``` 16 | 17 | 2. Import person.json with `mongoimport` executable 18 | 19 | ```bash 20 | mongoimport --jsonArray -d -c --file 21 | ``` 22 | 23 | ## Run the project 24 | 25 | Execute this command in your terminal: 26 | 27 | ```bash 28 | dart bin/main.dart 29 | ``` 30 | 31 | Created from templates made available by Stagehand under a BSD-style 32 | [license](https://github.com/dart-lang/stagehand/blob/master/LICENSE). 33 | -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # Defines a default set of lint rules enforced for 2 | # projects at Google. For details and rationale, 3 | # see https://github.com/dart-lang/pedantic#enabled-lints. 4 | include: package:pedantic/analysis_options.yaml 5 | 6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints. 7 | # Uncomment to specify additional rules. 8 | # linter: 9 | # rules: 10 | # - camel_case_types 11 | 12 | analyzer: 13 | # exclude: 14 | # - path/to/excluded/files/** 15 | -------------------------------------------------------------------------------- /bin/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_mongo/dart_mongo.dart'; 2 | 3 | main(List arguments) async { 4 | int port = 8085; 5 | var server = await HttpServer.bind('localhost', port); 6 | Db db = Db('mongodb://localhost:27017/test'); 7 | await db.open(); 8 | 9 | print('Connected to database'); 10 | 11 | server.transform(HttpBodyHandler()).listen((HttpRequestBody reqBody) async { 12 | var request = reqBody.request; 13 | var response = request.response; 14 | 15 | switch (request.uri.path) { 16 | case '/': 17 | response.write('Hello, World!'); 18 | await response.close(); 19 | break; 20 | case '/people': 21 | PeopleController(reqBody, db); 22 | break; 23 | default: 24 | response 25 | ..statusCode = HttpStatus.notFound 26 | ..write('Not Found'); 27 | await response.close(); 28 | } 29 | }); 30 | 31 | print('Server listening at http://localhost:$port'); 32 | } 33 | -------------------------------------------------------------------------------- /lib/dart_mongo.dart: -------------------------------------------------------------------------------- 1 | library dart_mongo; 2 | 3 | export 'dart:io'; 4 | 5 | export 'package:http_server/http_server.dart'; 6 | export 'package:mongo_dart/mongo_dart.dart'; 7 | 8 | export './src/people_controller.dart'; 9 | -------------------------------------------------------------------------------- /lib/src/people_controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:http_server/http_server.dart'; 4 | import 'package:mongo_dart/mongo_dart.dart'; 5 | 6 | class PeopleController { 7 | PeopleController(this._reqBody, Db db) 8 | : _req = _reqBody.request, 9 | _store = db.collection('people') { 10 | handle(); 11 | } 12 | 13 | HttpRequestBody _reqBody; 14 | final HttpRequest _req; 15 | final DbCollection _store; 16 | 17 | handle() async { 18 | switch (_req.method) { 19 | case 'GET': 20 | await handleGet(); 21 | break; 22 | case 'POST': 23 | await handlePost(); 24 | break; 25 | case 'PUT': 26 | await handlePut(); 27 | break; 28 | case 'DELETE': 29 | await handleDelete(); 30 | break; 31 | case 'PATCH': 32 | await handlePatch(); 33 | break; 34 | default: 35 | _req.response.statusCode = 405; 36 | } 37 | 38 | await _req.response.close(); 39 | } 40 | 41 | handleGet() async { 42 | _req.response.write(await _store.find().toList()); 43 | } 44 | 45 | handlePost() async { 46 | _req.response.write(await _store.save(_reqBody.body)); 47 | } 48 | 49 | handlePut() async { 50 | var id = int.parse(_req.uri.queryParameters['id']); 51 | var itemToPut = await _store.findOne(where.eq('id', id)); 52 | 53 | if (itemToPut == null) { 54 | await _store.save(_reqBody.body); 55 | } else { 56 | await _store.update(itemToPut, _reqBody.body); 57 | } 58 | } 59 | 60 | handleDelete() async { 61 | var id = int.parse(_req.uri.queryParameters['id']); 62 | var itemToDelete = await _store.findOne(where.eq('id', id)); 63 | if (itemToDelete != null) { 64 | _req.response.write(await _store.remove(itemToDelete)); 65 | } 66 | } 67 | 68 | handlePatch() async { 69 | var id = int.parse(_req.uri.queryParameters['id']); 70 | var itemToPatch = await _store.findOne(where.eq('id', id)); 71 | _req.response 72 | .write(await _store.update(itemToPatch, {r'$set': _reqBody.body})); 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /people.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 1, 4 | "first_name": "Nolly", 5 | "last_name": "Montfort", 6 | "email": "nmontfort0@archive.org", 7 | "gender": "Male", 8 | "ip_address": "6.125.126.90" 9 | }, 10 | { 11 | "id": 2, 12 | "first_name": "Karim", 13 | "last_name": "Cordeux", 14 | "email": "kcordeux1@ft.com", 15 | "gender": "Male", 16 | "ip_address": "63.90.69.20" 17 | }, 18 | { 19 | "id": 3, 20 | "first_name": "Jamil", 21 | "last_name": "Ealles", 22 | "email": "jealles2@yandex.ru", 23 | "gender": "Male", 24 | "ip_address": "79.137.13.3" 25 | }, 26 | { 27 | "id": 4, 28 | "first_name": "Madlen", 29 | "last_name": "Ruslin", 30 | "email": "mruslin3@wordpress.com", 31 | "gender": "Female", 32 | "ip_address": "40.108.119.251" 33 | }, 34 | { 35 | "id": 5, 36 | "first_name": "Oren", 37 | "last_name": "Horbart", 38 | "email": "ohorbart4@japanpost.jp", 39 | "gender": "Male", 40 | "ip_address": "22.165.113.116" 41 | }, 42 | { 43 | "id": 6, 44 | "first_name": "Riobard", 45 | "last_name": "Wormstone", 46 | "email": "rwormstone5@cpanel.net", 47 | "gender": "Male", 48 | "ip_address": "13.24.39.142" 49 | }, 50 | { 51 | "id": 7, 52 | "first_name": "Celka", 53 | "last_name": "Seman", 54 | "email": "cseman6@shutterfly.com", 55 | "gender": "Female", 56 | "ip_address": "242.34.93.99" 57 | }, 58 | { 59 | "id": 8, 60 | "first_name": "Misty", 61 | "last_name": "Giveen", 62 | "email": "mgiveen7@slashdot.org", 63 | "gender": "Female", 64 | "ip_address": "10.234.208.101" 65 | }, 66 | { 67 | "id": 9, 68 | "first_name": "Rosy", 69 | "last_name": "Eard", 70 | "email": "reard8@woothemes.com", 71 | "gender": "Female", 72 | "ip_address": "10.175.114.158" 73 | }, 74 | { 75 | "id": 10, 76 | "first_name": "Crysta", 77 | "last_name": "Pecha", 78 | "email": "cpecha9@who.int", 79 | "gender": "Female", 80 | "ip_address": "40.113.116.170" 81 | }, 82 | { 83 | "id": 11, 84 | "first_name": "Perrine", 85 | "last_name": "Ricson", 86 | "email": "pricsona@samsung.com", 87 | "gender": "Female", 88 | "ip_address": "18.128.58.55" 89 | }, 90 | { 91 | "id": 12, 92 | "first_name": "Reagen", 93 | "last_name": "Heams", 94 | "email": "rheamsb@aol.com", 95 | "gender": "Male", 96 | "ip_address": "83.197.33.249" 97 | }, 98 | { 99 | "id": 13, 100 | "first_name": "Fairlie", 101 | "last_name": "Spiers", 102 | "email": "fspiersc@purevolume.com", 103 | "gender": "Male", 104 | "ip_address": "73.216.181.217" 105 | }, 106 | { 107 | "id": 14, 108 | "first_name": "Tiebout", 109 | "last_name": "Waleworke", 110 | "email": "twaleworked@gravatar.com", 111 | "gender": "Male", 112 | "ip_address": "205.136.244.51" 113 | }, 114 | { 115 | "id": 15, 116 | "first_name": "Jacquenetta", 117 | "last_name": "Loomes", 118 | "email": "jloomese@technorati.com", 119 | "gender": "Female", 120 | "ip_address": "248.76.97.112" 121 | }, 122 | { 123 | "id": 16, 124 | "first_name": "Clim", 125 | "last_name": "Stainsby", 126 | "email": "cstainsbyf@behance.net", 127 | "gender": "Male", 128 | "ip_address": "142.11.167.9" 129 | }, 130 | { 131 | "id": 17, 132 | "first_name": "Christen", 133 | "last_name": "Forsey", 134 | "email": "cforseyg@cpanel.net", 135 | "gender": "Female", 136 | "ip_address": "100.38.246.132" 137 | }, 138 | { 139 | "id": 18, 140 | "first_name": "Roth", 141 | "last_name": "Boultwood", 142 | "email": "rboultwoodh@google.com", 143 | "gender": "Male", 144 | "ip_address": "221.162.174.88" 145 | }, 146 | { 147 | "id": 19, 148 | "first_name": "Ashien", 149 | "last_name": "Lindmark", 150 | "email": "alindmarki@mysql.com", 151 | "gender": "Female", 152 | "ip_address": "25.63.158.224" 153 | }, 154 | { 155 | "id": 20, 156 | "first_name": "Leilah", 157 | "last_name": "Bremmell", 158 | "email": "lbremmellj@netvibes.com", 159 | "gender": "Female", 160 | "ip_address": "36.216.160.184" 161 | }, 162 | { 163 | "id": 21, 164 | "first_name": "Laurent", 165 | "last_name": "Petschel", 166 | "email": "lpetschelk@etsy.com", 167 | "gender": "Male", 168 | "ip_address": "232.23.115.32" 169 | }, 170 | { 171 | "id": 22, 172 | "first_name": "Carita", 173 | "last_name": "Tebb", 174 | "email": "ctebbl@networksolutions.com", 175 | "gender": "Female", 176 | "ip_address": "195.226.4.235" 177 | }, 178 | { 179 | "id": 23, 180 | "first_name": "Junina", 181 | "last_name": "Ferrao", 182 | "email": "jferraom@npr.org", 183 | "gender": "Female", 184 | "ip_address": "100.174.101.81" 185 | }, 186 | { 187 | "id": 24, 188 | "first_name": "Carlota", 189 | "last_name": "Sinclair", 190 | "email": "csinclairn@chron.com", 191 | "gender": "Female", 192 | "ip_address": "69.160.232.182" 193 | }, 194 | { 195 | "id": 25, 196 | "first_name": "Hilton", 197 | "last_name": "Sutherel", 198 | "email": "hsutherelo@netscape.com", 199 | "gender": "Male", 200 | "ip_address": "142.252.46.89" 201 | }, 202 | { 203 | "id": 26, 204 | "first_name": "Mychal", 205 | "last_name": "Tillard", 206 | "email": "mtillardp@blogger.com", 207 | "gender": "Male", 208 | "ip_address": "201.88.105.63" 209 | }, 210 | { 211 | "id": 27, 212 | "first_name": "Sherwin", 213 | "last_name": "Jankin", 214 | "email": "sjankinq@myspace.com", 215 | "gender": "Male", 216 | "ip_address": "155.26.253.0" 217 | }, 218 | { 219 | "id": 28, 220 | "first_name": "Fraser", 221 | "last_name": "Lacotte", 222 | "email": "flacotter@sciencedirect.com", 223 | "gender": "Male", 224 | "ip_address": "43.61.68.36" 225 | }, 226 | { 227 | "id": 29, 228 | "first_name": "Crawford", 229 | "last_name": "Riseam", 230 | "email": "criseams@woothemes.com", 231 | "gender": "Male", 232 | "ip_address": "133.151.110.65" 233 | }, 234 | { 235 | "id": 30, 236 | "first_name": "Roseanne", 237 | "last_name": "Carnduff", 238 | "email": "rcarndufft@springer.com", 239 | "gender": "Female", 240 | "ip_address": "193.47.109.80" 241 | }, 242 | { 243 | "id": 31, 244 | "first_name": "Cross", 245 | "last_name": "Everwin", 246 | "email": "ceverwinu@hubpages.com", 247 | "gender": "Male", 248 | "ip_address": "6.168.15.10" 249 | }, 250 | { 251 | "id": 32, 252 | "first_name": "Bentlee", 253 | "last_name": "Sloy", 254 | "email": "bsloyv@hugedomains.com", 255 | "gender": "Male", 256 | "ip_address": "41.120.120.139" 257 | }, 258 | { 259 | "id": 33, 260 | "first_name": "Adria", 261 | "last_name": "Gwatkins", 262 | "email": "agwatkinsw@issuu.com", 263 | "gender": "Female", 264 | "ip_address": "213.116.183.214" 265 | }, 266 | { 267 | "id": 34, 268 | "first_name": "Terry", 269 | "last_name": "Abell", 270 | "email": "tabellx@mapy.cz", 271 | "gender": "Female", 272 | "ip_address": "65.166.243.124" 273 | }, 274 | { 275 | "id": 35, 276 | "first_name": "Jackquelin", 277 | "last_name": "Glasscock", 278 | "email": "jglasscocky@engadget.com", 279 | "gender": "Female", 280 | "ip_address": "168.12.219.102" 281 | }, 282 | { 283 | "id": 36, 284 | "first_name": "Gardener", 285 | "last_name": "Claisse", 286 | "email": "gclaissez@barnesandnoble.com", 287 | "gender": "Male", 288 | "ip_address": "146.57.148.202" 289 | }, 290 | { 291 | "id": 37, 292 | "first_name": "Dulcy", 293 | "last_name": "Gardiner", 294 | "email": "dgardiner10@photobucket.com", 295 | "gender": "Female", 296 | "ip_address": "219.189.105.74" 297 | }, 298 | { 299 | "id": 38, 300 | "first_name": "Antonella", 301 | "last_name": "Allom", 302 | "email": "aallom11@cornell.edu", 303 | "gender": "Female", 304 | "ip_address": "200.161.108.233" 305 | }, 306 | { 307 | "id": 39, 308 | "first_name": "Arie", 309 | "last_name": "Regi", 310 | "email": "aregi12@google.com.br", 311 | "gender": "Male", 312 | "ip_address": "162.100.145.32" 313 | }, 314 | { 315 | "id": 40, 316 | "first_name": "Clayson", 317 | "last_name": "Ollivier", 318 | "email": "collivier13@archive.org", 319 | "gender": "Male", 320 | "ip_address": "69.59.36.235" 321 | }, 322 | { 323 | "id": 41, 324 | "first_name": "Lorena", 325 | "last_name": "Arkil", 326 | "email": "larkil14@wired.com", 327 | "gender": "Female", 328 | "ip_address": "14.65.140.125" 329 | }, 330 | { 331 | "id": 42, 332 | "first_name": "Coral", 333 | "last_name": "Spaice", 334 | "email": "cspaice15@indiatimes.com", 335 | "gender": "Female", 336 | "ip_address": "54.164.35.213" 337 | }, 338 | { 339 | "id": 43, 340 | "first_name": "Ingunna", 341 | "last_name": "Mibourne", 342 | "email": "imibourne16@purevolume.com", 343 | "gender": "Female", 344 | "ip_address": "159.4.226.135" 345 | }, 346 | { 347 | "id": 44, 348 | "first_name": "Cloris", 349 | "last_name": "Brockington", 350 | "email": "cbrockington17@amazon.co.uk", 351 | "gender": "Female", 352 | "ip_address": "187.1.205.195" 353 | }, 354 | { 355 | "id": 45, 356 | "first_name": "Clemence", 357 | "last_name": "Scutts", 358 | "email": "cscutts18@spiegel.de", 359 | "gender": "Female", 360 | "ip_address": "220.60.235.107" 361 | }, 362 | { 363 | "id": 46, 364 | "first_name": "Isabelita", 365 | "last_name": "Parysowna", 366 | "email": "iparysowna19@yolasite.com", 367 | "gender": "Female", 368 | "ip_address": "116.118.204.184" 369 | }, 370 | { 371 | "id": 47, 372 | "first_name": "Adrien", 373 | "last_name": "Blacksell", 374 | "email": "ablacksell1a@springer.com", 375 | "gender": "Male", 376 | "ip_address": "109.51.34.56" 377 | }, 378 | { 379 | "id": 48, 380 | "first_name": "Germaine", 381 | "last_name": "Hadlow", 382 | "email": "ghadlow1b@liveinternet.ru", 383 | "gender": "Female", 384 | "ip_address": "181.10.157.202" 385 | }, 386 | { 387 | "id": 49, 388 | "first_name": "Abraham", 389 | "last_name": "Meeks", 390 | "email": "ameeks1c@cnet.com", 391 | "gender": "Male", 392 | "ip_address": "186.143.126.127" 393 | }, 394 | { 395 | "id": 50, 396 | "first_name": "Doro", 397 | "last_name": "McReynolds", 398 | "email": "dmcreynolds1d@google.pl", 399 | "gender": "Female", 400 | "ip_address": "83.62.192.162" 401 | }, 402 | { 403 | "id": 51, 404 | "first_name": "Elianore", 405 | "last_name": "McRobbie", 406 | "email": "emcrobbie1e@miitbeian.gov.cn", 407 | "gender": "Female", 408 | "ip_address": "80.254.200.55" 409 | }, 410 | { 411 | "id": 52, 412 | "first_name": "Stormie", 413 | "last_name": "McBayne", 414 | "email": "smcbayne1f@wikia.com", 415 | "gender": "Female", 416 | "ip_address": "226.185.89.51" 417 | }, 418 | { 419 | "id": 53, 420 | "first_name": "Margalo", 421 | "last_name": "Dupoy", 422 | "email": "mdupoy1g@shinystat.com", 423 | "gender": "Female", 424 | "ip_address": "155.209.149.136" 425 | }, 426 | { 427 | "id": 54, 428 | "first_name": "Leticia", 429 | "last_name": "Lakeman", 430 | "email": "llakeman1h@washingtonpost.com", 431 | "gender": "Female", 432 | "ip_address": "67.169.175.222" 433 | }, 434 | { 435 | "id": 55, 436 | "first_name": "Marj", 437 | "last_name": "Shackleton", 438 | "email": "mshackleton1i@auda.org.au", 439 | "gender": "Female", 440 | "ip_address": "235.141.34.70" 441 | }, 442 | { 443 | "id": 56, 444 | "first_name": "Farlay", 445 | "last_name": "Poker", 446 | "email": "fpoker1j@springer.com", 447 | "gender": "Male", 448 | "ip_address": "78.240.236.33" 449 | }, 450 | { 451 | "id": 57, 452 | "first_name": "Wilie", 453 | "last_name": "Blest", 454 | "email": "wblest1k@imdb.com", 455 | "gender": "Female", 456 | "ip_address": "60.171.236.36" 457 | }, 458 | { 459 | "id": 58, 460 | "first_name": "Merl", 461 | "last_name": "Attrill", 462 | "email": "mattrill1l@constantcontact.com", 463 | "gender": "Female", 464 | "ip_address": "109.168.95.200" 465 | }, 466 | { 467 | "id": 59, 468 | "first_name": "Malia", 469 | "last_name": "Bourbon", 470 | "email": "mbourbon1m@forbes.com", 471 | "gender": "Female", 472 | "ip_address": "159.163.172.1" 473 | }, 474 | { 475 | "id": 60, 476 | "first_name": "Gothart", 477 | "last_name": "Wooster", 478 | "email": "gwooster1n@istockphoto.com", 479 | "gender": "Male", 480 | "ip_address": "168.198.29.153" 481 | }, 482 | { 483 | "id": 61, 484 | "first_name": "Amelia", 485 | "last_name": "Byng", 486 | "email": "abyng1o@dion.ne.jp", 487 | "gender": "Female", 488 | "ip_address": "43.92.102.52" 489 | }, 490 | { 491 | "id": 62, 492 | "first_name": "Sander", 493 | "last_name": "Audsley", 494 | "email": "saudsley1p@mapy.cz", 495 | "gender": "Male", 496 | "ip_address": "67.233.31.216" 497 | }, 498 | { 499 | "id": 63, 500 | "first_name": "Carmine", 501 | "last_name": "Gomersall", 502 | "email": "cgomersall1q@yellowbook.com", 503 | "gender": "Male", 504 | "ip_address": "139.248.32.134" 505 | }, 506 | { 507 | "id": 64, 508 | "first_name": "Dulci", 509 | "last_name": "Barford", 510 | "email": "dbarford1r@taobao.com", 511 | "gender": "Female", 512 | "ip_address": "161.38.247.194" 513 | }, 514 | { 515 | "id": 65, 516 | "first_name": "Gretchen", 517 | "last_name": "Mathevet", 518 | "email": "gmathevet1s@seattletimes.com", 519 | "gender": "Female", 520 | "ip_address": "211.50.5.162" 521 | }, 522 | { 523 | "id": 66, 524 | "first_name": "Belicia", 525 | "last_name": "Cessford", 526 | "email": "bcessford1t@so-net.ne.jp", 527 | "gender": "Female", 528 | "ip_address": "188.252.111.30" 529 | }, 530 | { 531 | "id": 67, 532 | "first_name": "Dorette", 533 | "last_name": "Hele", 534 | "email": "dhele1u@independent.co.uk", 535 | "gender": "Female", 536 | "ip_address": "157.120.176.28" 537 | }, 538 | { 539 | "id": 68, 540 | "first_name": "Quent", 541 | "last_name": "Giddings", 542 | "email": "qgiddings1v@ucoz.ru", 543 | "gender": "Male", 544 | "ip_address": "207.191.196.203" 545 | }, 546 | { 547 | "id": 69, 548 | "first_name": "Melodie", 549 | "last_name": "Ruane", 550 | "email": "mruane1w@icio.us", 551 | "gender": "Female", 552 | "ip_address": "177.144.70.20" 553 | }, 554 | { 555 | "id": 70, 556 | "first_name": "Eddy", 557 | "last_name": "Bloom", 558 | "email": "ebloom1x@mozilla.com", 559 | "gender": "Female", 560 | "ip_address": "191.99.108.210" 561 | }, 562 | { 563 | "id": 71, 564 | "first_name": "Carola", 565 | "last_name": "DelaField", 566 | "email": "cdelafield1y@goodreads.com", 567 | "gender": "Female", 568 | "ip_address": "228.254.35.138" 569 | }, 570 | { 571 | "id": 72, 572 | "first_name": "Margret", 573 | "last_name": "Durning", 574 | "email": "mdurning1z@cargocollective.com", 575 | "gender": "Female", 576 | "ip_address": "109.103.23.183" 577 | }, 578 | { 579 | "id": 73, 580 | "first_name": "Dody", 581 | "last_name": "Joskowicz", 582 | "email": "djoskowicz20@cornell.edu", 583 | "gender": "Female", 584 | "ip_address": "136.95.193.172" 585 | }, 586 | { 587 | "id": 74, 588 | "first_name": "Tedie", 589 | "last_name": "Drust", 590 | "email": "tdrust21@surveymonkey.com", 591 | "gender": "Male", 592 | "ip_address": "129.166.213.254" 593 | }, 594 | { 595 | "id": 75, 596 | "first_name": "Egor", 597 | "last_name": "Rennels", 598 | "email": "erennels22@devhub.com", 599 | "gender": "Male", 600 | "ip_address": "166.46.34.215" 601 | }, 602 | { 603 | "id": 76, 604 | "first_name": "Natalee", 605 | "last_name": "De Maine", 606 | "email": "ndemaine23@taobao.com", 607 | "gender": "Female", 608 | "ip_address": "104.221.246.137" 609 | }, 610 | { 611 | "id": 77, 612 | "first_name": "Manon", 613 | "last_name": "Medwell", 614 | "email": "mmedwell24@examiner.com", 615 | "gender": "Female", 616 | "ip_address": "250.228.153.124" 617 | }, 618 | { 619 | "id": 78, 620 | "first_name": "Arleen", 621 | "last_name": "Comi", 622 | "email": "acomi25@istockphoto.com", 623 | "gender": "Female", 624 | "ip_address": "82.225.79.224" 625 | }, 626 | { 627 | "id": 79, 628 | "first_name": "Tommy", 629 | "last_name": "Danell", 630 | "email": "tdanell26@cmu.edu", 631 | "gender": "Female", 632 | "ip_address": "70.191.237.219" 633 | }, 634 | { 635 | "id": 80, 636 | "first_name": "Dyanne", 637 | "last_name": "Monkhouse", 638 | "email": "dmonkhouse27@tamu.edu", 639 | "gender": "Female", 640 | "ip_address": "173.15.18.130" 641 | }, 642 | { 643 | "id": 81, 644 | "first_name": "Garik", 645 | "last_name": "Sicha", 646 | "email": "gsicha28@scribd.com", 647 | "gender": "Male", 648 | "ip_address": "10.15.122.206" 649 | }, 650 | { 651 | "id": 82, 652 | "first_name": "Goldia", 653 | "last_name": "Niche", 654 | "email": "gniche29@example.com", 655 | "gender": "Female", 656 | "ip_address": "50.207.253.235" 657 | }, 658 | { 659 | "id": 83, 660 | "first_name": "Chiquia", 661 | "last_name": "Dillingstone", 662 | "email": "cdillingstone2a@mtv.com", 663 | "gender": "Female", 664 | "ip_address": "240.206.70.247" 665 | }, 666 | { 667 | "id": 84, 668 | "first_name": "Rachel", 669 | "last_name": "Popland", 670 | "email": "rpopland2b@arstechnica.com", 671 | "gender": "Female", 672 | "ip_address": "150.241.87.31" 673 | }, 674 | { 675 | "id": 85, 676 | "first_name": "Gayla", 677 | "last_name": "Genthner", 678 | "email": "ggenthner2c@i2i.jp", 679 | "gender": "Female", 680 | "ip_address": "105.124.80.152" 681 | }, 682 | { 683 | "id": 86, 684 | "first_name": "Frederic", 685 | "last_name": "McGarrie", 686 | "email": "fmcgarrie2d@nature.com", 687 | "gender": "Male", 688 | "ip_address": "160.233.78.25" 689 | }, 690 | { 691 | "id": 87, 692 | "first_name": "Agnese", 693 | "last_name": "Briton", 694 | "email": "abriton2e@over-blog.com", 695 | "gender": "Female", 696 | "ip_address": "139.231.48.134" 697 | }, 698 | { 699 | "id": 88, 700 | "first_name": "Lilyan", 701 | "last_name": "Sargood", 702 | "email": "lsargood2f@shinystat.com", 703 | "gender": "Female", 704 | "ip_address": "64.37.14.10" 705 | }, 706 | { 707 | "id": 89, 708 | "first_name": "Mimi", 709 | "last_name": "Burdfield", 710 | "email": "mburdfield2g@sciencedaily.com", 711 | "gender": "Female", 712 | "ip_address": "193.10.97.78" 713 | }, 714 | { 715 | "id": 90, 716 | "first_name": "Haslett", 717 | "last_name": "Bente", 718 | "email": "hbente2h@npr.org", 719 | "gender": "Male", 720 | "ip_address": "158.137.163.111" 721 | }, 722 | { 723 | "id": 91, 724 | "first_name": "Sophia", 725 | "last_name": "Riley", 726 | "email": "sriley2i@bloglovin.com", 727 | "gender": "Female", 728 | "ip_address": "167.184.253.129" 729 | }, 730 | { 731 | "id": 92, 732 | "first_name": "Erinn", 733 | "last_name": "Brian", 734 | "email": "ebrian2j@nps.gov", 735 | "gender": "Female", 736 | "ip_address": "187.236.48.235" 737 | }, 738 | { 739 | "id": 93, 740 | "first_name": "Norene", 741 | "last_name": "Berggren", 742 | "email": "nberggren2k@ibm.com", 743 | "gender": "Female", 744 | "ip_address": "53.106.20.196" 745 | }, 746 | { 747 | "id": 94, 748 | "first_name": "Irv", 749 | "last_name": "Milesop", 750 | "email": "imilesop2l@spiegel.de", 751 | "gender": "Male", 752 | "ip_address": "190.186.103.236" 753 | }, 754 | { 755 | "id": 95, 756 | "first_name": "Olivia", 757 | "last_name": "Landell", 758 | "email": "olandell2m@skype.com", 759 | "gender": "Female", 760 | "ip_address": "250.180.86.84" 761 | }, 762 | { 763 | "id": 96, 764 | "first_name": "Wendell", 765 | "last_name": "Catonne", 766 | "email": "wcatonne2n@psu.edu", 767 | "gender": "Male", 768 | "ip_address": "210.249.95.145" 769 | }, 770 | { 771 | "id": 97, 772 | "first_name": "Ede", 773 | "last_name": "Baylie", 774 | "email": "ebaylie2o@bing.com", 775 | "gender": "Female", 776 | "ip_address": "52.63.244.77" 777 | }, 778 | { 779 | "id": 98, 780 | "first_name": "Anissa", 781 | "last_name": "Almon", 782 | "email": "aalmon2p@phpbb.com", 783 | "gender": "Female", 784 | "ip_address": "7.153.107.64" 785 | }, 786 | { 787 | "id": 99, 788 | "first_name": "Laural", 789 | "last_name": "Dun", 790 | "email": "ldun2q@buzzfeed.com", 791 | "gender": "Female", 792 | "ip_address": "255.239.126.31" 793 | }, 794 | { 795 | "id": 100, 796 | "first_name": "Calypso", 797 | "last_name": "Gippes", 798 | "email": "cgippes2r@xinhuanet.com", 799 | "gender": "Female", 800 | "ip_address": "97.252.84.122" 801 | } 802 | ] 803 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: dart_mongo 2 | description: A command-line application that talks to a MongoDB database. 3 | version: 1.0.0 4 | homepage: https://www.creativebracket.com 5 | author: Jermaine Oppong 6 | 7 | environment: 8 | sdk: '>=2.1.0 <3.0.0' 9 | 10 | dependencies: 11 | mongo_dart: ^0.3.6 12 | http_server: ^0.9.8+1 13 | 14 | dev_dependencies: 15 | pedantic: ^1.0.0 16 | test: ^1.0.0 17 | -------------------------------------------------------------------------------- /test/dart_mongo_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:dart_mongo/dart_mongo.dart'; 2 | import 'package:test/test.dart'; 3 | 4 | void main() { 5 | test('calculate', () { 6 | // expect(calculate(), 42); 7 | }); 8 | } 9 | --------------------------------------------------------------------------------