0

There are a lot of operation i would like to perform on a field that stores an array. The problem is most of these operations are not supported by mongodb.

So from a performance point of view, what is the best way

  1. Perform these operations using the mongodb server side scripting(javascript). or
  2. Load the array into my script, perform my operations and push it back into mongo
John Grant
  • 72
  • 2
  • 7

1 Answers1

0

Take a look at these performance issues with mongodb server side scripting

does server-side-javascript-function-have-performance-issues-in-mongodb

is-it-not-recommended-to-use-server-side-stored-functions-in-mongodb

but with second solution that you are talking about, in that you have to bring data on client side perform operation and then send it back, in case of large amount of data it can cause your application performance to degrade.So you have to decide the solution based on your application.

Community
  • 1
  • 1
Saheed Hussain
  • 1,096
  • 11
  • 12