Home > Software engineering >  Pagination on array stored in a document field using MongoDB .Net Driver
Pagination on array stored in a document field using MongoDB .Net Driver

Time:12-06

How do I apply pagination in the animals field using C# with MongoDB .Net driver?

The schema is:

[{
    id: 1,
    name: "Tom",
    animals: ["cat", "dog", "fish", "bear", "dog1", "fish1", "bear1",]
},
{
    id: 2,
    name: "Rob",
    animals: ["shark", "snake", "fish", "bear", "panda"]
},
{
    id: 3,
    name: "Matt",
    animals: ["cat", "fish", "bear"]
}]

The solution is given enter image description here

  • Related