Skip to content

Instantly share code, notes, and snippets.

-- DROP function test2;
CREATE OR REPLACE FUNCTION test2() RETURNS void AS $$
DECLARE
siteId integer;
attributeId int;
enumId int;
BEGIN
FOR siteId IN select id from site LOOP
db.threads.aggregate([
{
"$match": {
"$text": {
"$search": "modx"
}
}
},
{
"$facet":{
db.threads.aggregate([
{
"$match": {
"ci": {
"$in": [ObjectId("60fefc1f535ed8596d08c151"), ObjectId("6102e3c4535ed8596d3723da"), ObjectId("612163ca535ed8596dd57732"), ObjectId("61216d9a535ed8596dd5d3a0"), ObjectId("6121762d535ed8596dd61f13"), ObjectId("6121d19d535ed8596dd8c7e8"), ObjectId("6121f226535ed8596dd9b0da"), ObjectId("6121f282535ed8596dd9b386"), ObjectId("61227509535ed8596dde2d40"), ObjectId("61227a35535ed8596dde637d"), ObjectId("61227ed2535ed8596ddea2d1"), ObjectId("6122b672535ed8596d0bda85"), ObjectId("612385b8535ed8596d56e6a9"), ObjectId("6124099c535ed8596d5bd76a"), ObjectId("61311e2a535ed8596dc35295"), ObjectId("61312b78535ed8596dc4a781"), ObjectId("61312e75535ed8596dc4eb72"), ObjectId("61313c49535ed8596dc6c06b"), ObjectId("61313d82535ed8596dc6eb85"), ObjectId("6131420c535ed8596dc77e46"), ObjectId("6132851f535ed8596deabc01"), ObjectId("6133e0fe535ed8596d1800a1"), ObjectId("6133e4f6535ed8596d185541"), ObjectId("6133e5c8535ed8596d1867fa"), ObjectId("6133e948535ed8596d18bd9c"), O
@dzhuryn
dzhuryn / test
Last active May 14, 2023 17:13
test
db.threads
//.explain("executionStats")
.aggregate([
{
"$match": {
"ci": {
"$in": [
ObjectId("60fefc1f535ed8596d08c151"),
ObjectId("6102e3c4535ed8596d3723da"),
ObjectId("612163ca535ed8596dd57732"),
import React, {Suspense, useEffect, useMemo, useRef, useState} from "react";
import ReactDOM from 'react-dom';
import Slider from "react-slick";
import CardBig from "../Catalog/CardBig";
import {default as axios} from "axios";
import {connect, useSelector} from "react-redux";
import Test from "../Test";
import Context from './../../Context'
//картинка и превю маленькое
'thumb' => [
'type' => 'thumb',
'image' => 'image',
'actions' => ['del', 'edit'],
'attr' => 'style="width:60px; float:left;"'
],
'image' => [
'type' => 'image',
'thumb' => 'thumb',
@dzhuryn
dzhuryn / sale.php
Last active May 25, 2021 17:59
sale.php
<?php
if (empty($user)) {
return;
}
$totalPrice = $commerce->getCart()->getTotal();
$sales = [];
@dzhuryn
dzhuryn / MultiFieldsEvoSearchIndex.php
Created May 7, 2021 17:28
MultiFieldsEvoSearchIndex.php
<?php
$id = $params['data']['id'];
$document = \DocumentManager::get($id);
$tvs = $document->getTvAttribute()->pluck('value','name')->toArray();
$mfContent = json_decode($tvs['mf_content'],true);
if(!function_exists('parseContent')){
@dzhuryn
dzhuryn / site_content.php
Created April 29, 2021 11:54
Change Site_content
<?php
class SiteContent
{
public function scopeWithTVs($query, $tvList = array(), $sep = ':', $tree = false)
{
$main_table = 'site_content';
if ($tree) {
$main_table = 't2';
@dzhuryn
dzhuryn / evo.sh
Created March 7, 2021 11:56
evo.sh
#!/bin/bash
# basic script, before use need change logins,passwords in this script
# put this script in project folder and run: sh evo.sh
## vova krasavchyk
#variables
EVO_VERSION="3.x-dev"
INSTALL_TYPE=1
DATABASE_TYPE="mysql"