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

mongodb bulk find and remove operation in php

As I wanted to delete a collection that consists approx 50M data(monthly), the normal delete operation was throwing a timeout error even after declaring timeout to -1. the query I am using is $this->where('ts', '>', $start)->where('ts', '<' ,…
Jonas Boshen
  • 75
  • 1
  • 1
  • 9
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

Laravel+MongoDB eloquent relation not working

I am new to MongoDB so pardon me if my approch is incorrect. I am building an application where I have created simple role and permission management. There are separate collections for permissions and roles. A role can have multiple permissions and…
0
votes
2 answers

Why laravel returns an empty array for a has many relationship?

I am using jenssegers/laravel-mongodb and i have schema is like below Ticket Collection : { "_id": ObjectId("5f32d9bb486e94459b6531c3"), "subject": "\"URGENT\" Non-Compliance In (Eastern Region)", "content": "abc", …
hu7sy
  • 983
  • 1
  • 13
  • 47
0
votes
1 answer

Better solution to get column from Relationship with Main Model columns

Need a better solution There is a Post which belongs to multiple Categories and both having Many-to-Many relationship in between them. The intermediate table for many-to-many relationship is PostCategory. PostCategory contains post_id, category_id…
Haridarshan
  • 1,898
  • 1
  • 23
  • 38
0
votes
1 answer

adMethodCallException: Call to undefined method App\Candidate::name() on Jenssegers\Mongodb\Eloquent\Model

I'm trying to save a document on the database in mongo usin a 'jenssegers/laravel-mongodb' model this is the model
af_159623
  • 197
  • 10
0
votes
1 answer

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Class 'MongoDB\Client' not found

I followed this commands. $ sudo pecl install mongodb $ composer require jenssegers/mongodb use MongoDB\Client AS Mongo; $mongo = new Mongo(); I am using NGNIX and ubuntu 20. In localhost it is working but in server it is not. In localhost I am…
0
votes
3 answers

Laravel 5.7 mongodb atlas connection problem using jenssegers/mongodb

I want to connect my laravel 5.7 application(I used the 3.4 version of jenssegers/mongodb) with a mongodb in atlas, I tried in localhost(I isntalled the mongo extension) and everything is ok but with atlas i got an error message: Failed to parse…
SAFSAF
  • 375
  • 1
  • 4
  • 14
0
votes
1 answer

Wrong date fetch with eloquentt from MongoDB

I get wrong date from MongoDB using Eloquent in Laravel. My record in database looks like this "created_at" : ISODate("2020-11-17T15:30:42.131+01:00") Code to get records from MongoDB $taskObj = TaskComments::where('task_id',…
Earphan
  • 364
  • 1
  • 4
  • 13
0
votes
1 answer

How can I copy data from one MongoDB collection to another using jenssegers

I wanted to copy specific attributes from all documents in one MongoDB collection to another. I am using Lumen (v6.0.2) with jenssegers/mongodb(3.6.0). Is it possible to do it without looping through the documents?
Jayadevan
  • 1,306
  • 2
  • 12
  • 33
0
votes
1 answer

Laravel, MongoDB: Include events with "touching" start/end times in query

I'm going to give a brief overview about the app configuration before I go into the query. I am running a Laravel 6 app using MongoDB through Jenssegers MongoDB plugin. So far I have not had to write a raw mongo query and I hope I won't have to for…
0
votes
0 answers

can't use $lookup in jensseger mongodb to merge collections

I'm using mongodb and laravel to join two collections 'Course' and 'Course Objectives' using lookup but it is giving me error as: "$pipeline is not a list (unexpected index: "$lookup")". The code is: $data = Course::raw(function($collection){ …
0
votes
1 answer

Get data based on time Mongo DB (Laravel)

array:4 [▼ "_id" => ObjectId {#1108 ▶} "Date" => UTCDateTime {#1112 ▼ +"milliseconds": "1591399800000" } "token" => "1013875" "value" => "78.65" ] Hi, The sample object is as above, I need to get data(collection) where the Date is…
Dinesh Naik
  • 17
  • 1
  • 4
0
votes
1 answer

Search on indexed property mongodb returns no result after laravel upgrade

Recently i upgraded Laravel from 5.5 to 6. Now when i execute the query below, it returns no result where on 5.5 it did. I am using the JensSegers mongodb package. Asset_id is indexed This my method. public function show($id) { return…
0
votes
2 answers

Subscription won't update in database after subscription is updated in Stripe using Laravel Cashier and Jenssegers MongoDB

I am having trouble getting my new subscription to be updated in MongoDB Database. Im using Laravel Cashier, Stripe, and Jenssegers MongoDB. In the stripe dashboard, users have been successfully added as customers and subscribers. Here is the…
Laing
  • 3
  • 5