I have these two models:

> 
> User.js
> 
> 
> 

```
const UserSchema = new Schema({
  profile: {
    type: Schema.Types.ObjectId,
    ref: "profiles",
  },
  following: [
    {
      type: Schema.Types.ObjectId,
      ref: "users",
    },
  ],
});

module.exports = User = mongoose.model("users", UserSchema);

```

> 
> Profile.js
> 
> 
> 

```
const ProfileSchema = new Schema({
  videoURL: {
    type: String,
  },
});

module.exports = Profile = mongoose.model("profiles", ProfileSchema);

```

Here's an example of a `User` document:

```
{
  "following":  [
    {
      "profile":{
        "videoURL":"video_url_1"
      }
    },
    {
      "profile":{
        "videoURL":"video_url_2"
      }
    },
    {
      "profile":{}
    },
    {
      "profile":{
        "videoURL":"video_url_3"
      }
    },
    {
      "profile":{
        "videoURL":"video_url_4"
      }
    },
    {
      "profile":{
        "videoURL":"video_url_5"
      }
    },
    {
      "profile":{}
    },
    {
      "profile":{
        "videoURL":"video_url_6"
      }
    }
  ]
}

```

I am trying to implement an infinite scroll of the videos of the users followed by the connected user.

> 
> This means, I will have to filter user.following.profile.videoURL
> WHERE videoURL exists
> 
> 
> 

Suppose, I will be loading two videos, by two videos:

* Response 1: ["video\_url\_1","video\_url\_2"]
* Response 2: ["video\_url\_3","video\_url\_4"]
* Response 3: ["video\_url\_5","video\_url\_6"]

Usually, infinite scroll is easy because all I have to load the documents 2 by 2 by order of storage without filtering on any field.  

**Example: Displaying the followed users two by two in an infinite scroll**

```
User.findById(user_id).populate({
    path: "following",
    options: {
      skip: 2 * page,
      limit: 2,
    },
  });

```

But, now I have to perform filtering on each followed\_user.profile.video, and return two by two. And I don't see how I can perform **BOTH** the filtering and the infinite scroll at the same time.

---

**NOTE:** According to the [documentation](https://mongoosejs.com/docs/populate.html):

> 
> In general, there is no way to make populate() filter stories based on properties of the story's author. For example, the below query won't return any results, even though author is populated.
> 
> 
> 

```
const story = await Story.
  findOne({ 'author.name': 'Ian Fleming' }).
  populate('author').
  exec();
story; // null

```

So I suppose, there is no way for me to use populate to filter based `user.followers`, based on each `user.follower.profile.videoURL`