Post.aggregate([
{
$lookup: {
from: 'definitions',
localField: 'definition',
foreignField: '_id',
as: 'definitions'
}
},
{
$match: {
'definitions.likes': { $gte: 10 }
}
}
])
function replace(str) {
let nesting = 0;
let result = '';
for (let i = 0; i < str.length; i++) {
if (str[i] === '(') {
nesting++;
} else if (str[i] === ')') {
nesting--;
} else if (str[i] === ',' && nesting !== 0) {
result += ';';
continue;
}
result += str[i];
}
return result;
}
console.log(replace(str));
console.log(str.replace(/\((.*?),(.*?)\)/, '($1;$2)'));
location ^~ /pma/ {
alias /usr/share/phpmyadmin/;
index index.php index.html;
location ~ /pma(/.*\.php) {
include fastcgi_params;
fastcgi_param SERVER_NAME localhost;
fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$1;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
}
}