|
3 | 3 | "schemaVersion": "1.0",
|
4 | 4 | "runOnRequirements": [
|
5 | 5 | {
|
| 6 | + "minServerVersion": "3.6", |
6 | 7 | "topologies": [
|
7 | 8 | "replicaset",
|
8 | 9 | "sharded-replicaset"
|
|
168 | 169 | "description": "Test with document comment - pre 4.4",
|
169 | 170 | "runOnRequirements": [
|
170 | 171 | {
|
171 |
| - "minServerVersion": "3.6.0", |
172 | 172 | "maxServerVersion": "4.2.99"
|
173 | 173 | }
|
174 | 174 | ],
|
|
213 | 213 | },
|
214 | 214 | {
|
215 | 215 | "description": "Test with string comment",
|
216 |
| - "runOnRequirements": [ |
217 |
| - { |
218 |
| - "minServerVersion": "3.6.0" |
219 |
| - } |
220 |
| - ], |
221 | 216 | "operations": [
|
222 | 217 | {
|
223 | 218 | "name": "createChangeStream",
|
|
347 | 342 | "description": "Test that comment is not set on getMore - pre 4.4",
|
348 | 343 | "runOnRequirements": [
|
349 | 344 | {
|
350 |
| - "minServerVersion": "3.6.0", |
351 | 345 | "maxServerVersion": "4.3.99",
|
352 | 346 | "topologies": [
|
353 | 347 | "replicaset"
|
|
431 | 425 | ]
|
432 | 426 | }
|
433 | 427 | ]
|
| 428 | + }, |
| 429 | + { |
| 430 | + "description": "to field is set in a rename change event", |
| 431 | + "runOnRequirements": [ |
| 432 | + { |
| 433 | + "minServerVersion": "4.0.1" |
| 434 | + } |
| 435 | + ], |
| 436 | + "operations": [ |
| 437 | + { |
| 438 | + "name": "createChangeStream", |
| 439 | + "object": "collection0", |
| 440 | + "arguments": { |
| 441 | + "pipeline": [] |
| 442 | + }, |
| 443 | + "saveResultAsEntity": "changeStream0" |
| 444 | + }, |
| 445 | + { |
| 446 | + "name": "dropCollection", |
| 447 | + "object": "database0", |
| 448 | + "arguments": { |
| 449 | + "collection": "collection1" |
| 450 | + } |
| 451 | + }, |
| 452 | + { |
| 453 | + "name": "rename", |
| 454 | + "object": "collection0", |
| 455 | + "arguments": { |
| 456 | + "to": "collection1" |
| 457 | + } |
| 458 | + }, |
| 459 | + { |
| 460 | + "name": "iterateUntilDocumentOrError", |
| 461 | + "object": "changeStream0", |
| 462 | + "expectResult": { |
| 463 | + "operationType": "rename", |
| 464 | + "ns": { |
| 465 | + "db": "database0", |
| 466 | + "coll": "collection0" |
| 467 | + }, |
| 468 | + "to": { |
| 469 | + "db": "database0", |
| 470 | + "coll": "collection1" |
| 471 | + } |
| 472 | + } |
| 473 | + } |
| 474 | + ] |
| 475 | + }, |
| 476 | + { |
| 477 | + "description": "Test unknown operationType MUST NOT err", |
| 478 | + "operations": [ |
| 479 | + { |
| 480 | + "name": "createChangeStream", |
| 481 | + "object": "collection0", |
| 482 | + "arguments": { |
| 483 | + "pipeline": [ |
| 484 | + { |
| 485 | + "$project": { |
| 486 | + "operationType": "addedInFutureMongoDBVersion", |
| 487 | + "ns": 1 |
| 488 | + } |
| 489 | + } |
| 490 | + ] |
| 491 | + }, |
| 492 | + "saveResultAsEntity": "changeStream0" |
| 493 | + }, |
| 494 | + { |
| 495 | + "name": "insertOne", |
| 496 | + "object": "collection0", |
| 497 | + "arguments": { |
| 498 | + "document": { |
| 499 | + "_id": 1, |
| 500 | + "a": 1 |
| 501 | + } |
| 502 | + } |
| 503 | + }, |
| 504 | + { |
| 505 | + "name": "iterateUntilDocumentOrError", |
| 506 | + "object": "changeStream0", |
| 507 | + "expectResult": { |
| 508 | + "operationType": "addedInFutureMongoDBVersion", |
| 509 | + "ns": { |
| 510 | + "db": "database0", |
| 511 | + "coll": "collection0" |
| 512 | + } |
| 513 | + } |
| 514 | + } |
| 515 | + ] |
| 516 | + }, |
| 517 | + { |
| 518 | + "description": "Test newField added in response MUST NOT err", |
| 519 | + "operations": [ |
| 520 | + { |
| 521 | + "name": "createChangeStream", |
| 522 | + "object": "collection0", |
| 523 | + "arguments": { |
| 524 | + "pipeline": [ |
| 525 | + { |
| 526 | + "$project": { |
| 527 | + "operationType": 1, |
| 528 | + "ns": 1, |
| 529 | + "newField": "newFieldValue" |
| 530 | + } |
| 531 | + } |
| 532 | + ] |
| 533 | + }, |
| 534 | + "saveResultAsEntity": "changeStream0" |
| 535 | + }, |
| 536 | + { |
| 537 | + "name": "insertOne", |
| 538 | + "object": "collection0", |
| 539 | + "arguments": { |
| 540 | + "document": { |
| 541 | + "_id": 1, |
| 542 | + "a": 1 |
| 543 | + } |
| 544 | + } |
| 545 | + }, |
| 546 | + { |
| 547 | + "name": "iterateUntilDocumentOrError", |
| 548 | + "object": "changeStream0", |
| 549 | + "expectResult": { |
| 550 | + "operationType": "insert", |
| 551 | + "ns": { |
| 552 | + "db": "database0", |
| 553 | + "coll": "collection0" |
| 554 | + }, |
| 555 | + "newField": "newFieldValue" |
| 556 | + } |
| 557 | + } |
| 558 | + ] |
| 559 | + }, |
| 560 | + { |
| 561 | + "description": "Test new structure in ns document MUST NOT err", |
| 562 | + "operations": [ |
| 563 | + { |
| 564 | + "name": "createChangeStream", |
| 565 | + "object": "collection0", |
| 566 | + "arguments": { |
| 567 | + "pipeline": [ |
| 568 | + { |
| 569 | + "$project": { |
| 570 | + "operationType": "insert", |
| 571 | + "ns.viewOn": "db.coll" |
| 572 | + } |
| 573 | + } |
| 574 | + ] |
| 575 | + }, |
| 576 | + "saveResultAsEntity": "changeStream0" |
| 577 | + }, |
| 578 | + { |
| 579 | + "name": "insertOne", |
| 580 | + "object": "collection0", |
| 581 | + "arguments": { |
| 582 | + "document": { |
| 583 | + "_id": 1, |
| 584 | + "a": 1 |
| 585 | + } |
| 586 | + } |
| 587 | + }, |
| 588 | + { |
| 589 | + "name": "iterateUntilDocumentOrError", |
| 590 | + "object": "changeStream0", |
| 591 | + "expectResult": { |
| 592 | + "operationType": "insert", |
| 593 | + "ns": { |
| 594 | + "viewOn": "db.coll" |
| 595 | + } |
| 596 | + } |
| 597 | + } |
| 598 | + ] |
| 599 | + }, |
| 600 | + { |
| 601 | + "description": "Test modified structure in ns document MUST NOT err", |
| 602 | + "operations": [ |
| 603 | + { |
| 604 | + "name": "createChangeStream", |
| 605 | + "object": "collection0", |
| 606 | + "arguments": { |
| 607 | + "pipeline": [ |
| 608 | + { |
| 609 | + "$project": { |
| 610 | + "operationType": "insert", |
| 611 | + "ns": { |
| 612 | + "db": "$ns.db", |
| 613 | + "coll": "$ns.coll", |
| 614 | + "viewOn": "db.coll" |
| 615 | + } |
| 616 | + } |
| 617 | + } |
| 618 | + ] |
| 619 | + }, |
| 620 | + "saveResultAsEntity": "changeStream0" |
| 621 | + }, |
| 622 | + { |
| 623 | + "name": "insertOne", |
| 624 | + "object": "collection0", |
| 625 | + "arguments": { |
| 626 | + "document": { |
| 627 | + "_id": 1, |
| 628 | + "a": 1 |
| 629 | + } |
| 630 | + } |
| 631 | + }, |
| 632 | + { |
| 633 | + "name": "iterateUntilDocumentOrError", |
| 634 | + "object": "changeStream0", |
| 635 | + "expectResult": { |
| 636 | + "operationType": "insert", |
| 637 | + "ns": { |
| 638 | + "db": "database0", |
| 639 | + "coll": "collection0", |
| 640 | + "viewOn": "db.coll" |
| 641 | + } |
| 642 | + } |
| 643 | + } |
| 644 | + ] |
| 645 | + }, |
| 646 | + { |
| 647 | + "description": "Test server error on projecting out _id", |
| 648 | + "runOnRequirements": [ |
| 649 | + { |
| 650 | + "minServerVersion": "4.2" |
| 651 | + } |
| 652 | + ], |
| 653 | + "operations": [ |
| 654 | + { |
| 655 | + "name": "createChangeStream", |
| 656 | + "object": "collection0", |
| 657 | + "arguments": { |
| 658 | + "pipeline": [ |
| 659 | + { |
| 660 | + "$project": { |
| 661 | + "_id": 0 |
| 662 | + } |
| 663 | + } |
| 664 | + ] |
| 665 | + }, |
| 666 | + "saveResultAsEntity": "changeStream0" |
| 667 | + }, |
| 668 | + { |
| 669 | + "name": "insertOne", |
| 670 | + "object": "collection0", |
| 671 | + "arguments": { |
| 672 | + "document": { |
| 673 | + "_id": 1, |
| 674 | + "a": 1 |
| 675 | + } |
| 676 | + } |
| 677 | + }, |
| 678 | + { |
| 679 | + "name": "iterateUntilDocumentOrError", |
| 680 | + "object": "changeStream0", |
| 681 | + "expectError": { |
| 682 | + "errorCode": 280, |
| 683 | + "errorCodeName": "ChangeStreamFatalError", |
| 684 | + "errorLabelsContain": [ |
| 685 | + "NonResumableChangeStreamError" |
| 686 | + ] |
| 687 | + } |
| 688 | + } |
| 689 | + ] |
| 690 | + }, |
| 691 | + { |
| 692 | + "description": "Test projection in change stream returns expected fields", |
| 693 | + "operations": [ |
| 694 | + { |
| 695 | + "name": "createChangeStream", |
| 696 | + "object": "collection0", |
| 697 | + "arguments": { |
| 698 | + "pipeline": [ |
| 699 | + { |
| 700 | + "$project": { |
| 701 | + "optype": "$operationType", |
| 702 | + "ns": 1, |
| 703 | + "newField": "value" |
| 704 | + } |
| 705 | + } |
| 706 | + ] |
| 707 | + }, |
| 708 | + "saveResultAsEntity": "changeStream0" |
| 709 | + }, |
| 710 | + { |
| 711 | + "name": "insertOne", |
| 712 | + "object": "collection0", |
| 713 | + "arguments": { |
| 714 | + "document": { |
| 715 | + "_id": 1, |
| 716 | + "a": 1 |
| 717 | + } |
| 718 | + } |
| 719 | + }, |
| 720 | + { |
| 721 | + "name": "iterateUntilDocumentOrError", |
| 722 | + "object": "changeStream0", |
| 723 | + "expectResult": { |
| 724 | + "optype": "insert", |
| 725 | + "ns": { |
| 726 | + "db": "database0", |
| 727 | + "coll": "collection0" |
| 728 | + }, |
| 729 | + "newField": "value" |
| 730 | + } |
| 731 | + } |
| 732 | + ] |
434 | 733 | }
|
435 | 734 | ]
|
436 | 735 | }
|
0 commit comments