Category: mongodb

MongoDB: Convert the JSON field to fields to facilitate queries

Promise: I am a beginner with MongoDB This is mongodb document: { "_id" : ObjectId("5ed7643985b9e34fa96fa2dc"), "message" : "{"data":"2020-06-03T08:50:01.075289Z","users":"37","azione":"Inserimento prima Scheda di Controllo","soggetto":"schede_gravidanza","oggetto":[{"id":47},{"codiceScheda":"2020TF63001"},{"codiceGravidanza":"TF63"},{"stato":"O"},{"peso":"70"},{"paMax":"70"},{"paMin":"80"},{"fc":"90"},{"codUteIns":"9310"}]}", "context" : [ ], "level" : 200, "level_name" : "INFO", "channel" : "PREG", "datetime" : "2020-06-03 10:50:01", "extra"…

How to get all collections of a MongoDB database from a Doctrine DocumentManager?

I need to make a Doctrine migration to remove all collections (except for one) from a MongoDB database. This would be equivalent MongoDB code: var collectionNames = db.getCollectionNames(); for(var i = 0, len = collectionNames.length; i < len ; i++){…

The class ‘AppRepositoryUsersRepository’ was not found in the chain configured namespaces AppDocument

I’m trying to configure connection Symfony 5.0.8 with MongoDB for api. If call register user from browser i’m returned this error. The class ‘AppRepositoryUsersRepository’ was not found in the chain configured namespaces AppDocument This errors exists if write next code:…

Can not install DoctrineMongoDBBundle Symfony 4 [closed]

My goal is to import all data from here : “https://adresse.data.gouv.fr/data/ban/adresses/latest/addok/” into a MongoDB Base. Try to install and use “DoctrineMongoDBBundle”. I’m using this website “https://symfony.com/doc/master/bundles/DoctrineMongoDBBundle/installation.html“. The bundle is correctly installed, but when I’m doing the following command “php bin/console…

How can I install doctrine/mongodb-odm-bundle?

When I run composer require doctrine/mongodb-odm-bundle from CMD I get these cryptic messages: Using version ^4.1 for doctrine/mongodb-odm-bundle ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an…

Symfony Api Platform 400 Not Found Error While doing default item operations with MongoDB ODM

I would like to do default item crud operations with odm. I did with ORM it was okay but I have problems with ODM. I created project in terminal with composer composer create-project symfony/skeleton bookshop-api Installed the API Platform’s server…

Attempted to call an undefined method named "allowDiskUse" of class "DoctrineODMMongoDBAggregationBuilder

I am trying to get last purchases with item, location and batch. So I tried to get ids of each by grouping. I can’t use group command because it is huge data and can not be handle by group command….