This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"_id": 1, | |
"texts": [ | |
{ "language": "english", "text": "hello" }, | |
{ "language": "german", "text": "hallo" }, | |
{ "language": "french", "text": "bonjour" } | |
] | |
}, … | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.project; | |
import com.mongodb.ConnectionString; | |
import com.mongodb.MongoClientSettings; | |
import com.mongodb.client.*; | |
import com.mongodb.client.model.Filters; | |
import com.mongodb.client.model.UpdateOptions; | |
import com.mongodb.client.model.changestream.ChangeStreamDocument; | |
import com.mongodb.client.model.changestream.FullDocument; | |
import com.mongodb.client.result.UpdateResult; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
appname := myapp | |
CXX := g++ | |
CXXFLAGS := -Wall -g | |
srcfiles := $(shell find . -maxdepth 1 -name "*.cpp") | |
objects := $(patsubst %.cpp, %.o, $(srcfiles)) | |
all: $(appname) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) json_object | |
2) json_objectagg | |
3) json_array | |
4) json_arrayagg | |
SELECT JSON_OBJECT ( | |
KEY 'deptno' IS d.department_id FORMAT JSON, | |
KEY 'deptname' IS d.department_name FORMAT JSON | |
) "Department Objects" | |
FROM departments d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
export MONGODB_HOME=/opt/mongodb | |
export MONGODB_BIN=${MONGODB_HOME}/bin | |
export MONGO="${MONGODB_BIN}/mongo --host centos --port 27018 --quiet" | |
export MONGODUMP="${MONGODB_BIN}/mongodump --host centos --port 27018" | |
export BACKUP_DIR=${MONGODB_HOME}/data/backup | |
echo "BACKUP DATABASE" | |
_DB_LIST=(`echo "show dbs" | $MONGO | grep -v admin | grep -v config | awk {'print $1'}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// sample | |
db.test_collection.insert({field01:"A", field02:"a", field03:1}) | |
db.test_collection.insert({field01:"A", field02:"a", field03:2}) | |
db.test_collection.insert({field01:"A", field02:"a", field03:3}) | |
/* | |
'view_sum_naver':{ $cond:{ if: {$eq:['naver','$origin']}, then:1, else:0, } }, | |
'view_sum_naver':{ $cond:{ if: {$eq:['naver','$origin']}, then:1, else:0, } }, | |
'view_sum_naver':{ $cond:{ if: {$eq:['naver','$origin']}, then:1, else:0, } }, | |
'view_sum_naver':{ $cond:{ if: {$eq:['naver','$origin']}, then:1, else:0, } }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove Duplicates | |
function removeDuplicates(array) { | |
return array.sort().filter((a, b) => array.indexOf(a) === b) | |
}; | |
// Add CIDR Address on User | |
addUserClientSource = function(user,dbname,cidr) { | |
var nsAdmin = "admin." + user; | |
var res = db.system.users.aggregate([ | |
{$match:{"_id" : nsAdmin, "user" : user, "db" : dbname}}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CFLAGS=-stdlib=libc++ pip install jpype1-py3 | |
tar -xzvf mecab-0.996-ko-0.9.2.tar.gz | |
cd mecab-0.996-ko-0.9.2 | |
./configure | |
make;sudo make install | |
MACOSX_DEPLOYMENT_TARGET=10.15 pip install mecab | |
python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OpsManager 4.2.x | |
SERVICE_USER="ec2-user" | |
SERVICE_GROUP="users" | |
service mongodb-mms-automation-agent stop | |
chown -R $SERVICE_USER:$SERVICE_GROUP /data/ | |
chown -R $SERVICE_USER:$SERVICE_GROUP /var/log/mongodb-mms-automation/ | |
chown -R $SERVICE_USER:$SERVICE_GROUP /etc/mongodb-mms/ | |
chown -R $SERVICE_USER:$SERVICE_GROUP /var/lib/mongodb-mms-automation/ | |
sed -i 's/SERVICE_USER="mongod"/SERVICE_USER="'$SERVICE_USER'"\nSERVICE_GROUP="'$SERVICE_GROUP'"/g' /etc/init.d/mongodb-mms-automation-agent | |
sed -i 's/-g $SERVICE_USER/-g $SERVICE_GROUP/g' /etc/init.d/mongodb-mms-automation-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in ./*.csv | |
do | |
start=$(sed -n '/Word/=' $file) | |
end=$(wc -l $file | awk '{print $1}') | |
sed -n ${start},${end}p $file > ./new/$file | |
done |
NewerOlder