Skip to content

How to use batchSize property in Loopback mongodb connector #4363

Open

Description

@KunalBurangi

How to use batchSize property in Loopback Mongodb connector
is it like this ?
collection.find({},{"batchSize":10000}

Activity

  1. javakamal1 commented on Mar 13, 2024

    @javakamal1

    @KunalBurangi

    batchSize can also be set in the data source configuration

    var dataSource = new DataSource({ connector: require('loopback-connector-mongodb'), host: 'localhost', port: 27017, database: 'mydatabase', username: 'username', password: 'password', batchSize: 10000 // Specify your desired batch size here });

    In case you want to set on a specific query then this should also work. This allows you to override the default batch size configured in the data source for this specific query.

    Model.find({ where: { /* Your filter conditions */ }, batchSize: 10000 // Specify your desired batch size here })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions