Questions tagged [laravel-mongodb]

25 questions
0
votes
1 answer

PHP laravel mogodb - Filter documents with only date and only time (whereDate, whereTime)

composer install package jenssegers/mongodb I have a list of documents in which there is a date field as follows ISODate("2020-05-28T06:34:23.000Z") how to filter out data with only date and time distinct condition /** @var $db…
0
votes
1 answer

How to SELECT COUNT(column_name) in laravel mongodb

How can we retrieve the size of an array in the laravel-mongodb's get() function? Update: Ultimately, I want to get the size of the array column for each qualified document Example, for each document, I have an array of members data. Therefore, I…
Gabsys
  • 166
  • 1
  • 9
0
votes
2 answers

laravel get one of each duplicate column

The structure of the table in the database is as follows: id body user_id group_id 1 test1 1 1 2 test1 2 1 3 test1 3 1 3 test2 4 2 4 test3 5 3 I want to get the first row from each group_id with Eloquent/DB Facade or MongoDB…
Mehdi
  • 1
0
votes
2 answers

hasMany relationship return null with mongodb (jenssegers) laravel

i have laravel 8 project with jenssegers (Mongodb Database) but my hasMany relationship not work between Product & Category Model my Product mongo object : { "_id" : ObjectId("5dcaafb8eaec3701a2774d29") "category_ids" : [ …
0
votes
0 answers

Importing into meilisearch from mongodb using laravel scout takes too long

I have around 6 million rows in my mongodb collection and importing into meilisearch using php artisan scout:import 'model' takes forever to finish. Importing data with limit option php artisan scout:import 'model' -c 10000 gives me the following…
0
votes
0 answers

Updating php.ini with extension=php_mongodb.dll returning NULL is command prompt (Laravel | jenssegers / laravel-mongodb)

Trying to install jenssegers/laravel-mongodb. Downloaded MongoDB PHP driver (1.9.1 DLL) from https://pecl.php.net/package/mongodb. Placed it in C:/xampp/php/ext/ folder. Updated php.ini file by adding extension=php_mongodb.dll. Once I add this line…
Raghu Acharya
  • 196
  • 1
  • 13
0
votes
1 answer

Mongodb filter data on multiple levels

I have a collection of employees containing employee data and some events with start and end times... I want to query data in order to get a subset of a specific employee's events based on the start and the end of events. employees = [ { _id:…
0
votes
1 answer

Class 'Jenssegers\Mongodb\Eloquent\Model' not found

Laravel Version: 7.16.1 PHP Version: 7.4 Database Driver & Version: "jenssegers/mongodb": "4.0.0-alpha.1" I have a queue application that I call from the console. When I want to insert collection I am getting below error. What would be the reason?…
omero
  • 93
  • 1
  • 4
  • 10
0
votes
1 answer

Jessneggers / Laravel MongoDB whereRaw lookup not working

I migrated my database from Sql Server to MongoDB I want to Join existing customer Table with contact Table . Customer have multiple contacts . I tried whereRaw lookup customer collection { "_id": 77, "custid": 93 } Contact…
Neeraj Verma
  • 2,174
  • 6
  • 30
  • 51
-2
votes
1 answer

facing problem while trying to select specific columns from laravel relationship

My project runs on PHP 8.1.18 Laravel 9.52.7 that uses Mongodb driver (https://github.com/jenssegers/laravel-mongodb). Project::with(['skills' => function($q) {$q->select('_id', 'name');}])->first(); The following is part of the exception I get:
felixkpt
  • 128
  • 3
  • 10
1
2