Read & delete from mongodb with python multiprocessing

I have a mongodb with a collection incoming and a collection target. A worker process currently is doing the following (simplified) : def worker(number): incomings = db.incoming.find() buffersize=5 readcounter=0 for incoming in incomings: readcounter+=1 documentToInsert={‘keyfield’:incoming[“keyfield”], +other fields after some treatments…} documentsToInsert.append(incoming) documentToDelete={‘_id’:incoming[“_id”]} documentsToDelete.append(documentToDelete) if readcounter >= readbuffer: readcounter=0 db.incoming.remove({‘_id’: { ‘$in’: [ObjectId(docs[“_id”]) for docs in…

MongoDB: IllegalStateException: The pool is closed error message in Spring Boot application

I’m getting this info message: 19-October-24 08:05:53:481 INFO Thread-4 o.m.d.connection:71 – Closed connection [connectionId{localValue:35, serverValue:38}] to mongodb:27017 because the pool has been closed. And also the following errors: java.lang.IllegalStateException: The pool is closed at com.mongodb.internal.connection.ConcurrentPool.get(ConcurrentPool.java:137) at java.lang.IllegalStateException: state should be: open at com.mongodb.assertions.Assertions.isTrue(Assertions.java:70) This is how I’m creating the MongoClient, plain and simple: @Bean @Override…

Read & delete from mongodb with python multiprocessing

I have a mongodb with a collection incoming and a collection target. A worker process currently is doing the following (simplified) : def worker(number): incomings = db.incoming.find() buffersize=5 readcounter=0 for incoming in incomings: readcounter+=1 documentToInsert={‘keyfield’:incoming[“keyfield”], +other fields after some treatments…} documentsToInsert.append(incoming) documentToDelete={‘_id’:incoming[“_id”]} documentsToDelete.append(documentToDelete) if readcounter >= readbuffer: readcounter=0 db.incoming.remove({‘_id’: { ‘$in’: [ObjectId(docs[“_id”]) for docs in…

How to get mongodb document for matched query using MongoTemplate when collection name in MongoDB and pojo name is different? [on hold]

I am new to spring-boot and MongoDB. I want to retrieve Player PlayerId , which is in “Players” collection in MongoDB and I have created POJO named “Player”. I am using MongoTemplate. I am using below code. Query query =new Query(); query.addCriteria(Criteria.where(input).is(value)); List<Player> players=mongoTemplate.find(query, Player.class); //It’s not returning any value. //Where input and value are…