Questions tagged [pymongo-3.x]

Version 3 of [pymongo]

Version 3 of the official Python driver for MongoDB.

PyMongo 3 is not backward compatible with PyMongo 2:

PyMongo 3.0 brings a large number of API changes. Be sure to read the changes listed below before upgrading from PyMongo 2.x

Warning: PyMongo no longer supports Python 2.4, 2.5, or 3.1. If you must use PyMongo with these versions of Python the 2.x branch of PyMongo will be minimally supported for some time.

See the full changelog for more information.

If you're not sure what version of PyMongo you're running, consider using the generic tag.

324 questions
-1
votes
1 answer

How to get the last N records from the MongoDB database using PyMongo

I am using the pymongo with python to perform CRUD operations to a mongodb database. And I need to get the last 10 records, Here's my code: from pymongo import MongoClient # get the values of the environment variables MONGODB_HOSTNAME =…
Jananath Banuka
  • 2,951
  • 8
  • 57
  • 105
-1
votes
2 answers

How do I rename parent field name and nested field value in mongodb using pymongo?

I have following document: { "dataset_path":"path_of_dataset", "project_1":{ "model_1":"path_of_model_1", "model_2":"path_of_model_2" } } I want to change "project_1" to "renamed_project_1" and "path_of_model_1" to…
Muhammad Hassan
  • 4,079
  • 1
  • 13
  • 27
-1
votes
1 answer

Pymongo Aggregation Pipeline is returning only 100 Documents

I have a simple pipeline and running fine in MongoDB Compass, but the same pipeline when I try to execute using Pymongo I got less number of documents. When I checked the result cursor is having or limiting only the 100 documents, but in Compass I…
user8781522
  • 71
  • 3
  • 11
-1
votes
1 answer

How to include NULL or None values for the "IN" clause query in pymongo?

I want find the paths in mongodb which also contains None values if path is not present in database. But problem is "IN" clause query only consider values which exists. Here is my code. veye_path = [path['dir_path'] for path in veye_db.find({"uuid":…
Hiba Rehman
  • 127
  • 2
  • 9
-1
votes
2 answers

Flask-WTForm combination is receiving data (request.form), but is not saving in RegistrationForm()

I am trying to make a simple web app where I can upload data from a client to a database, and then send it back. I have everything done except the user authentication and session handling. I am new to Flask-WTForms (and flask tbh), and my example…
-1
votes
1 answer

Navigation in the same page with Django, Python and MongoDB

I want to make something like this: https://morelab.deusto.es/publications/ Something like the Advanced search of that page, but I don't know how can I make the 'navigation pages'. I am using Django 1.10.5, Python 3.6 and MongoDB with Pymongo. I…
Ana
  • 9
  • 4
-2
votes
1 answer

What the difference between insert, update and save?

What the difference between theese methods .insert_many(), .save(), .update(), .update_many() ? I want to push the docs to database and if the same doc was exist it will be updated or if no exsist it will be created
RoyalGoose
  • 453
  • 9
  • 24
-2
votes
1 answer

use pymongo without installing it

I want to use pymongo in my server code which will run in server machine, But don't have permission to install pip or any libraries as it is a shared machine, then how to access mongodb connection?
pranay das
  • 27
  • 1
  • 8
-3
votes
1 answer

/gevent/hub.py: except Exception, ex: SyntaxError

Traceback (most recent call last): File "main.py", line 4, in from bot import bot File "/root/musicbot/bot.py", line 7, in from database import db, text_search File "/root/musicbot/database.py", line 2, in
zsaz
  • 31
  • 2
1 2 3
21
22