Questions tagged [jenssegers-mongodb]

A MongoDB based Eloquent model and Query builder for Laravel (Moloquent)

An Eloquent model and Query builder with support for MongoDB, using the original Laravel API. This library extends the original Laravel classes, so it uses exactly the same methods.

GitHub Link

192 questions
1
vote
2 answers

Laravel Jensseger Mongodb belongsToMany returns empty array

I am trying to use a belongsToMany relation, in the following way: Model with belongsToMany relation: namespace App\Models; use Illuminate\Notifications\Notifiable; use Laravel\Passport\HasApiTokens; class Notification extends…
Daniel Valland
  • 1,057
  • 4
  • 21
  • 45
1
vote
0 answers

How to retrieve data from multiple collections mongo db laravel 5.4

Actually I want get data from two different Collections using join or $lookup method but always getting empty result . I am trying to get data by using Jenssegers\Mongodb\Eloquent\Model.
1
vote
0 answers

jenssegers mongodb update nested object

I have a mongodb table, that contains a fixture of a soccer tournament, so every matchweek looks like this: "number": 1, "games" : [ { "estadio" : "G C", "arbitro" : "M", "resultado" : "vs", …
Iván
  • 570
  • 5
  • 8
1
vote
3 answers

RelationNotFoundException Call to undefined relationship [userStories] on model [App\User]

I have created a relationship between User model and StoryModel. But it give me the Error:- Call to undefined relationship [userStories] on model [App\User]. May be I'm missing something. Following is my code which I'm…
Muhammad Haris
  • 290
  • 1
  • 8
  • 23
1
vote
2 answers

Push to a nested array in Mongo with Laravel

I have a structure of MongoDB that looks like this: Object_id { workflow { tree_id { other_ids {...} other_ids {...} other_ids {...} subscribers { subscriber_id { …
1
vote
0 answers

Saving Eloquent collection with Mongo

I have large, single MongoDB collections and I want to add a timestamp to each of its fields. I do it that way: $automation = Automation::all(); foreach ($automation as $workflowindex => $workflow) { foreach ($workflow['workflow'] as $itemindex…
1
vote
1 answer

How to resolve the missing dependency in AuthServiceProvider of laravel while register passport routes

When I'm trying to print laravel routes with following command php artisan route:list It throws following exception [Illuminate\Contracts\Container\BindingResolutionException] Unresolvable dependency resolving [Parameter #0 [ array…
Moeen Basra
  • 733
  • 4
  • 18
1
vote
1 answer

$match Array in a raw MongoDB Laravel Query

I'm working with mongodb in laravel using jenssegers driver and i have 3 documents likes this in my db { "_id" : ObjectId("594dd540bb7de924c0005583"), "cliente" : "Luis", "tipo" : "Luis", "paquete" : "Luis", "fecha" : null, "fechaE" : null,…
1
vote
1 answer

MongoDB\Driver\Exception\InvalidArgumentException Integer overflow detected on your platform: 300000000000

I'm getting error when i try indexing my document using laravel. This is my main code. By using die statements, I came to know that i'm getting this error "[MongoDB\Driver\Exception\InvalidArgumentException] Integer overflow detected on your…
1
vote
1 answer

laravel-mongodb increment with nested object

I have a post documents that schema looks like { "author": { "name": "John", "gender": 0 }, "stats": { "likes": 0 }, "content": "The new post", "updated_at":…
Benyi
  • 912
  • 2
  • 9
  • 24
1
vote
1 answer

Laravel-MongoDB query find all documents where field(array) has at least one element

I am using Laravel-MongoDB query builder. A document of my collection(words) is below: { "_id" : ObjectId("58464564545yb45y45yf"), "word" : "Bird", "keys" : [ {"title": "t1"}, {"title": "t2"} ] } How do I find all documents where the…
shoeab
  • 186
  • 3
  • 9
1
vote
1 answer

Getting an error with Jenssegers: Class 'MongoDB\Driver\Manager' not found

I'm using Laravel 5.4 with Valet. I've installed PHP 7.1 and MongoDB drivers for PHP. I've followed every instruction to setup my Laravel project with MongoDB but when I try to communicate with my DB I get this error: FatalThrowableError in…
McMazalf
  • 59
  • 1
  • 9
1
vote
1 answer

Laravel switch mysql to mongodb

After completed my project I deiced switch mysql to mongodb. I am using Laravel 5.4 version and for mongodb use jenssegers. For laravel mongdb installation I follow jenssegers installation documentations and installation successfully completed. But…
sandip kakade
  • 1,346
  • 5
  • 23
  • 49
1
vote
2 answers

Class MongoDB\Driver\Manager' not found

I am using XAMPP. Installed mongo version 3.4.1 If I hit $mongo command I get - MongoDB shell version v3.4.1 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.4.1 And If I hit $php -i | grep mongo then I get - mongodb support =>…
Progi1990
  • 57
  • 1
  • 3
  • 13
1
vote
1 answer

Laravel MongoDB library 'jenssegers/laravel-mongodb' hasMany relationship is not working

I am using MongoDB library https://github.com/jenssegers/laravel-mongodb version 3.1.0-alpha in Laravel 5.3.28 I have two collections in MongoDB and I want to make a hasMany relation b/w them. Means each Employee performs many tasks. I have used…
okconfused
  • 3,567
  • 4
  • 25
  • 38