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
1 answer

Can't insert data into Mongodb in Laravel

Let me explain all the step that I followed. I am using LAMP. First of all I installed Laravel , MongoDB and jenssegers/laravel-mongodb pakage. For this I followed this link. After that I create database, table and insert data using terminal with…
Dhaval
  • 1,393
  • 5
  • 29
  • 55
1
vote
1 answer

Jenssegers mongodb Auth::user() - Trying to get property of non-object

Reading Jenssegers mongodb documentation i have install this module to get access to mongodb functions. In first step I configure user login/registration issues and after catch this error. `Trying to get property of non-object ... array('guard' =>…
1
vote
2 answers

select sum column and group by with Mongodb and Laravel

I have a issue with my query: I want to SELECT "user_info" with SUM "amount" and GROUP BY "user_id" I am using Laravel 5 and jenssegers/laravel-mongodb Thank you so much.
1
vote
3 answers

Laravel 5 and MongoDB connection

No suitable servers found (serverselectiontryonce set): [Failed connecting to '127.0.0.1:27107': Connection refused] I install "jenssegers/mongodb": "^3.0" using composer, but am getting error, i can't connect mongodb.
bala.alab
  • 66
  • 4
1
vote
2 answers

Laravel Class 'MongoDB\Driver\Manager' not found

I need your help in this topic, it concerns an error when trying to use mongodb with Laravel 5.1 project. I installed mongodb 2.6 in windows successfully I put the php_mongodb.dll in the ext folder of PHP 5.6.* and I added the mongodb extension in…
Badr B
  • 57
  • 1
  • 11
1
vote
0 answers

Fetch last N records Using Jenssegers laravel-mongodb

I want to fetch last 2 inserted chats of users according to the created_at time from the database in the sequence they were inserted using Jenssegers and Mongodb. I have tried some queries but not able to get the desired result. These queries gives…
Mukesh Joshi
  • 2,784
  • 4
  • 24
  • 34
1
vote
1 answer

Jenssegers MongoDB dot notation in fillable

I'm trying to get the dot notation working in Jenssegers MongoDB package for Laravel. According this issue it's already been implemented: link But it doesn't seem to work in the latest version. protected $fillable = ['title', 'some.data']; Doesn't…
Rob
  • 10,851
  • 21
  • 69
  • 109
1
vote
1 answer

How to use whereRaw in jenssegers/laravel-mongodb?

I'm using Laravel-MongoDB from jenssegers. Now I wish to create a custom query. By documentation, I need to use the RAW method. $model = User::whereRaw(['$limit : 5'])->get(); dd($model); Why my result is empty? Collection {#235 ▼ #items: [] }
lolalola
  • 3,773
  • 20
  • 60
  • 96
1
vote
1 answer

laravel jenssejers drop collection

I'm trying to figure out, how to delete all elements from the collection or drop the collection? I'm using Laravel 4.2 and "jenssegers/mongodb":"~2.0". Could you help me with this. Thank you!
Viktor
  • 819
  • 1
  • 12
  • 26
1
vote
1 answer

Laravel Mongodb embedded object in embedded object

I have a model News with embedsMany model Comment and in model Comment I have embedsMany model Reply when I do this: $new = News::create(["title"=>"Simple new", "body"=>"this is a simple news"]); $comment =…
1
vote
1 answer

Raw select using jenssegers Laravel-MongoDB

I add jenssegers Laravel-MongoDB package into my Laravel 4.2 project, and have a one problem. Maybe can help me. I cann't use DB::raw in select or get method. I need to change name of select column and add columns into one column, but Laravel return…
mrakodol
  • 1,143
  • 3
  • 12
  • 41
1
vote
2 answers

MongoDB & MySQL relationships in jenssegers/laravel-mongodb

Let's begin with some plain code. I have two following models. First is using MySQL: class Phrase extends \Eloquent { public function positions() { return $this->hasMany('Position'); } public function getIdAttribute($id) …
Mateusz Nowak
  • 4,021
  • 2
  • 25
  • 37
0
votes
1 answer

Laravel-Mongodb authentication always return false

I'm using my own collection named customer instead of users in this case. Model namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; // use Illuminate\Database\Eloquent\Model; use Jenssegers\Mongodb\Eloquent\Model; use…
0
votes
0 answers

Can't filter by date in date array on mongodb using jenssegers/laravel-mongodb

I have a date array and I want to retrieve those that are an interval. For example: Retrieve me those with a date between 2023-03-01 and 2023-03-31 My collection is presented : { "departures": [ "2022-10-23T23:30:00.000+00:00", // Date…
frenchqwerty
  • 97
  • 1
  • 14
0
votes
0 answers

getting Undefined index error when creating embeds many doc without primary key using Model in Laravel mongoDb

I'm first time using MongoDb with Laravel. I have one EntityForm Model as like below