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
LOAD CSV WITH HEADERS FROM "file:///offshore_leaks.nodes.address.csv" AS csvLine FIELDTERMINATOR ',' | |
CREATE (p:offshoreLeaksKnownAddress {nodeId:csvLine.node_id, name:csvLine.node_id, address:csvLine.address, | |
countryCode:csvLine.country_codes, countries:csvLine.countries, sourceId:csvLine.sourceID, | |
validUntil:csvLine.valid_until, note:csvLine.note}) |
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
LOAD CSV WITH HEADERS FROM "file:///offshore_leaks.nodes.officer.csv" AS csvLine FIELDTERMINATOR ',' | |
CREATE (p:offshoreLeaksOfficer {nodeId:csvLine.node_id, name:csvLine.name, countryCodes:csvLine.country_codes, | |
countries:csvLine.countries, sourceId:csvLine.sourceID, validUntil:csvLine.valid_until, note:csvLine.note}) |
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
db.[CollectionName].find().forEach(function(d){ db.getSiblingDB([Database])[CollectionName].insert(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
#Project Structure | |
MyCode | |
--MyCode.sln | |
--src | |
--MyCode.Common | |
--MyCode.WebApi | |
#Create Main Solution | |
> dotnet new sln --name MyCode |
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
#isin | |
df.loc[df['kod'].isin([1,4])] | |
#reverse isin | |
df.loc[~df['kod'].isin([2,3])] |
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
use master | |
go | |
alter database tempdb modify file (Name=tempdev, filename='D:\SQLServer\tempdb.mdf') | |
go | |
alter database tempdb modify file (Name=templog, filename='D:\SQLServer\templog.ldf') | |
go |
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
#install elasticsearch (this will install elasticsearch as a services and automatically start after installation done) | |
brew install elasticsearch | |
#install x-pack plugin for elasticsearch | |
elasticsearch-plugin install x-pack | |
#download kibana from https://www.elastic.co/products/kibana | |
copy the archive to some where that can easily accessible | |
#install x-pack for kibana (change directory to kibana bin directory) |
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
After done with installation process, open terminal as administrator and change to 'mongodb bin' directory in my case it would be C:\Program Files\MongoDB\Server\3.2\bin and run the following command | |
mongod.exe --dbpath=D:\mongodb --logpath=D:\mongolog\log.txt --install | |
--dbpath -specify the path name where mongodb should store the data | |
--logpath -specify the path for any log related to mongodb | |
At least those 2 parameters should be included inside the command line argument | |
To check either the service started or not, in the terminal, type the following command | |
> mongo.exe |
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
/* | |
Mongodb aggregrate function to do the following task: | |
1. date formatting ($project) | |
2. match condition | |
3. sort | |
4. limit | |
article schema | |
{ |