Tag Archives: mongodb

Getting error while setting up mongodb with php 7.0.27

Questions: I am trying to setup mongodb with php i am getting error as defined below Warning: PHP Startup: Unable to load dynamic library ‘C:\xampp\php\ext\php_mongo db.dll’ – %1 is not a valid Win32 application. here are the steps what i haev done I have downloaded the dll file from here pasted in C:\xampp\php\ext and added… Read More »

Mongodb, find all latest mapping records only

Questions: I have a mongodb collections with around 2000 millions data represents mobile devices. I will generate a device id when it rigister to my server, for some reasons, it may register multiple times, some there may be more than one deviceId for one device(imei) The generate id is the collection id so it is… Read More »

MongoDB atlas, connection not working

Questions: I just created a free MongoDB atlas cluster instance. But somehow I am failing to connect it from my application as well as from the MongoDB Compas. I get below error when I try to run my application. Caused by: com.mongodb.MongoTimeoutException: Timed out after 30000 ms while waiting for a server that matches WritableServerSelector.… Read More »

Implementing a MongoDB Inbound Flow with Spring Integration

Questions: We will have a Mongo collection contain multiple units of work. My idea is that the document will have a status field with four options: UNPROCESSED, PROCESSING, DONE, FAILED. Spring Integration will be configured to read from this db and process the messages stored there. An inbound Mongo DSL flow will read from the… Read More »

Authentication failed. mongodb with laravel 5.4.36

Questions: Try to connect the mongodb with laravel Laravel version 5.4.36 Downloaded the packages composer require jenssegers/mongodb:3.2.0 jenssegers/mongodb-session jenssegers/mongodb-sentry config/database.php ‘mongodb’ => [ ‘driver’ => ‘mongodb’, ‘host’ => ‘localhost’, ‘port’ => 27017, ‘database’ => ‘mydb’, ‘username’ => ‘usrename’, ‘password’ => ‘password’, ], Mongo db version 3.4.16 use mydb db.createUser( { user: “username”, pwd: “password”, roles:… Read More »

Mongodb connection with php

Questions: While connecting Mongodb with php it is returning an empty object. The versions are: php version 7.0.31 php mongodb extension 1.5.1 mongodb version 3.4.16 $manager = new MongoDB\Driver\Manager(“mongodb://username:password@localhost:27017/database”); var_dump($manager); It returns empty object /var/www/html/file/mongocall.php:12: object(MongoDB\Driver\Manager)[1] public ‘uri’ => string ‘mongodb://username:password@localhost:27017/database’ (length=53) public ‘cluster’ => array (size=0) empty got the result after executing composer require… Read More »

PHP MongoDB Error- No suitable servers found, tls_process_server_certificate:certificate verify failed calling ismaster

Questions: I am trying to use x509 certs to connect to MongoDB using PHP and getting the following error. I am able to do it using MongoDB Compas, so I know it’s not the MongoDB server. PHP Fatal error: Uncaught MongoDB\Driver\Exception\ConnectionTimeoutException: No suitable servers found (serverSelectionTryOnce set): [TLS handshake failed: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed calling… Read More »

MongoDB: $lookup with prefix

Questions: I have two mongo Collections (User and Country) and try to do a “join”. User { fooWrapper: { countrycode: Country.fooWrapper.bar } } Country { fooWrapper: { countrycode: bar } } Normally I could do something like this: { $lookup: { from: Country, localField: username, foreignField: username, as: country } } But because of the… Read More »

Spring Data MongoDB nosql injection

Questions: I have a question. Are queries in mongo repositories in spring data safe from NoSQL injection attack? Is it possible to successfully perform such attack on spring-boot application ? For example if I create interface which extends MongoRepository with my own methods, are default queries generated in safe way that such attack is not… Read More »