Open dpapala opened 4 years ago
@dpapala, show example for document models_types
@Smolevich Here is an example of a document
{"_id":"5dce720d624700008e000680","code":"123456","manufacturer_id":"43","manufacturer_name":"ABARTH","model_name":"500","type1":"500 1.4i 16v T-Jet","type2":"","doors":"3","seats":"5","begindate":"2008-07-01","enddate":"2012-12-01","chassistype":"Χάτσμπακ","cc":"1368","engine_power_kw":"99","engine_power_hp":"135","tax_hp":"10","co2_emission":"155","created_at":"2019-02-08T08:03:22.000Z","updated_at":"2019-11-15T12:19:18.000Z","assignments":{"1":"ABAR","2":"ABARTH","3":"43","5":"","6":"839","7":"43","34":"43"}}
same issue
$matched = Face::select('_id', 'name','status')->where("status", "Matched")->groupBy('name')->count();
Exemple of document :
{
"_id" : ObjectId("6064f87d529b985ca612fcd3"),
"name" : "Match_1617302724.4186473",
"status" : "Matched",
"location" : {
"top" : 395,
"bottom" : 470,
"right" : 2170,
"left" : 2095,
"y" : 380,
"width" : 75,
"height" : 75
},
"encodings" : [
-0.055271852761507,
0.122758761048317,
0.0695331767201424,
-0.112777456641197,
-0.142022922635078,
0.0292802043259144,
-0.00932658649981022,
-0.0829119309782982,
0.124038711190224,
-0.031645193696022,
0.281644582748413,
-0.0900372341275215,
-0.34865391254425,
-0.0530666373670101,
0.0392620116472244,
0.108178436756134,
-0.206843748688698,
-0.0901616513729095,
-0.0443461611866951,
-0.0569641664624214,
0.0122841419652104,
0.0893829092383385,
-0.026526216417551,
0.0317213647067547,
-0.094365619122982,
-0.39166533946991,
-0.0689378827810287,
-0.0751822292804718,
0.0771296545863152,
-0.145128697156906,
0.0555307380855083,
0.0803900063037872,
-0.163985580205917,
-0.0487529784440994,
0.00694756489247084,
0.0370412841439247,
-0.0876236110925674,
-0.11150223761797,
0.190512463450432,
0.0401624888181686,
-0.150475844740868,
-0.000540770590305328,
0.0115916868671775,
0.282071888446808,
0.0984104201197624,
0.0157422553747892,
0.0395125672221184,
-0.0904222726821899,
0.125584095716476,
-0.289161592721939,
0.0850858688354492,
0.172501027584076,
0.166233614087105,
0.0232401862740517,
0.0906986221671104,
-0.213029742240906,
-0.00357053987681866,
0.132295086979866,
-0.262838542461395,
0.120987378060818,
0.0903061255812645,
-0.079695351421833,
-0.0271913316100836,
-0.116545170545578,
0.200792267918587,
0.0645279511809349,
-0.117638789117336,
-0.0925739705562592,
0.185062259435654,
-0.043363094329834,
-0.0679896026849747,
0.0801887512207031,
-0.112784013152122,
-0.200504943728447,
-0.264760434627533,
0.0939658433198929,
0.312642365694046,
0.108703397214413,
-0.205890417098999,
-0.00477925781160593,
-0.0570149607956409,
-0.0176275931298733,
0.00230949907563627,
0.079352542757988,
-0.0881452932953835,
-0.0546839870512486,
-0.0974472239613533,
0.0873661711812019,
0.116291873157024,
-0.0543152093887329,
-0.00118218874558806,
0.298654109239578,
-0.00548255071043968,
0.0629594251513481,
0.0280847661197186,
0.0471175499260426,
-0.121787346899509,
0.000528912525624037,
-0.0740763694047928,
0.00764632364735007,
0.133864685893059,
-0.135708674788475,
0.0108713991940022,
0.136716023087502,
-0.204804256558418,
0.214066743850708,
0.00107648107223213,
-0.0281765647232533,
0.0358512736856937,
-0.0838737860321999,
-0.032456748187542,
0.0188745819032192,
0.209291011095047,
-0.327877640724182,
0.224193066358566,
0.153211772441864,
0.0193703528493643,
0.158673822879791,
0.018665786832571,
0.0289552919566631,
-0.00623600650578737,
-0.113061778247356,
-0.219266727566719,
-0.0805842131376266,
0.0668149366974831,
-0.0541879758238792,
-0.0377741195261478,
0.0444448105990887
],
"stats" : {},
"picture_id" : ObjectId("605db03bb1395415a27860f2")
}
Laravel 5.6 PHP 7.4 MongoDB 4.4
Hi, i'm using this query
models_types::orderby('manufacturer_name')->groupby('manufacturer_name')->pluck('manufacturer_name','_id');
so that to get an array with these 2 fields. If i remove the groupby works fine but with it i get the error Unrecognized expression '$last' With this query i want to retrieve distinct values of manufacturer_name in a collection that i have many documents with many manufacturers. The issue comes up if i want to retrieve the object id.I use Laravel 6.2 PHP 7.3 MongoDB 4.2