javascriptnode.jsdatabasenosqldatabase-server

FlexiDB Inserting 1000 rows is slow, how can I speed it up?


I am using FlexiDB Server, when I insert 1000 rows using the command below it takes some time:

$.collection('collection_name').insert(row);

How can this be accelerated?


Solution

  • You can use the command insert_bulk, create an array to hold all of your objects and then use the command insert_bulk to insert all at once.

    $.collection('collection_name').insert_bulk(rows);