Commit 6987049
fix(mongodb): make method arguments optional where mongosh allows empty calls (#54)
Several mongosh methods can be called with no arguments, but the parser
was requiring arguments. This fixes the grammar to match actual mongosh
behavior:
- find/findOne: support filter + projection args (arguments?)
- aggregate: allow empty pipeline (arguments?)
- Cursor methods: sort, collation, comment, hint, max, min, readConcern,
returnKey, showRecordId, projection - all accept empty calls
Verified against local mongosh instance.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent a57d4b6 commit 6987049
3 files changed
Lines changed: 1205 additions & 1032 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
251 | 252 | | |
252 | | - | |
| 253 | + | |
253 | 254 | | |
254 | 255 | | |
| 256 | + | |
255 | 257 | | |
256 | | - | |
| 258 | + | |
257 | 259 | | |
258 | 260 | | |
259 | 261 | | |
| |||
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
274 | | - | |
| 276 | + | |
275 | 277 | | |
276 | | - | |
| 278 | + | |
277 | 279 | | |
278 | 280 | | |
279 | 281 | | |
| |||
401 | 403 | | |
402 | 404 | | |
403 | 405 | | |
| 406 | + | |
404 | 407 | | |
405 | | - | |
| 408 | + | |
406 | 409 | | |
407 | 410 | | |
408 | 411 | | |
| |||
418 | 421 | | |
419 | 422 | | |
420 | 423 | | |
| 424 | + | |
421 | 425 | | |
422 | | - | |
| 426 | + | |
423 | 427 | | |
424 | 428 | | |
425 | 429 | | |
| |||
431 | 435 | | |
432 | 436 | | |
433 | 437 | | |
| 438 | + | |
434 | 439 | | |
435 | | - | |
| 440 | + | |
436 | 441 | | |
437 | 442 | | |
| 443 | + | |
438 | 444 | | |
439 | | - | |
| 445 | + | |
440 | 446 | | |
441 | 447 | | |
442 | 448 | | |
| |||
451 | 457 | | |
452 | 458 | | |
453 | 459 | | |
| 460 | + | |
454 | 461 | | |
455 | | - | |
| 462 | + | |
456 | 463 | | |
457 | 464 | | |
458 | 465 | | |
| |||
471 | 478 | | |
472 | 479 | | |
473 | 480 | | |
| 481 | + | |
474 | 482 | | |
475 | | - | |
| 483 | + | |
476 | 484 | | |
477 | 485 | | |
478 | 486 | | |
| |||
483 | 491 | | |
484 | 492 | | |
485 | 493 | | |
| 494 | + | |
486 | 495 | | |
487 | | - | |
| 496 | + | |
488 | 497 | | |
489 | 498 | | |
490 | 499 | | |
| |||
503 | 512 | | |
504 | 513 | | |
505 | 514 | | |
| 515 | + | |
506 | 516 | | |
507 | | - | |
| 517 | + | |
508 | 518 | | |
509 | 519 | | |
510 | 520 | | |
511 | 521 | | |
512 | 522 | | |
513 | 523 | | |
| 524 | + | |
514 | 525 | | |
515 | | - | |
| 526 | + | |
516 | 527 | | |
517 | 528 | | |
| 529 | + | |
518 | 530 | | |
519 | | - | |
| 531 | + | |
520 | 532 | | |
521 | 533 | | |
522 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
0 commit comments