-1

How to write custom functions in MongoDB for performing CRUD operations and with parameters (1 to 'N' fields like stored procedures in SQL)?

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38

1 Answers1

0

As of now, MongoDB doesn't support functions or stored procedures. But you can make use of the systme.js collection where you can store javascript functions. To start with you can refer this link

articuno
  • 546
  • 5
  • 12
  • Hi, Thanks for your time. I dont know how to write functions and i will have the JSON data and there can be 'N' of fields in JSON data and the fields changes from one client to another client. I need to write a function in such a way that it accepts the KEY:VALUE pairs and insert into the document as JSON data. Please help me how to write functions using parameters for 'N' no of fields in Mongodb using either JavaScript or Mapreduce. – Mahesh Kumar Apr 10 '15 at 09:31
  • You must use the Java API of MongoDB – articuno Apr 10 '15 at 11:10
  • Whether we can write map reduce functions or javascript functions for performing CRUD operations. Please check it and let me know – Mahesh Kumar Apr 10 '15 at 12:11