Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
Call MongoDB stored function from pymongo

I have the following function stored in mongodb:

db.system.js.save({
    _id: "testFunc",
    value: function() {
        return db.clients.find_one({}, {"_id" : False});
    }
});

How do I call the function above from python using pymongo? I have already tried db.eval('testFunc') and it doesn't work. The method is deprecated.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

eval, system_js etc. are all deprecated.

While you can still create javascript functions on the server, it comes with a clear warning:

Do not store application logic in the database. There are performance limitations to running JavaScript inside of MongoDB. Application code also is typically most effective when it shares version control with the application itself.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!