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.Commits.aggregate([ | |
{$sort: {_id:1}}, | |
{$unwind : "$Events"}, | |
{$project : { event : '$Events.Payload.Body._t'}}, | |
{$group : { | |
'_id' : '$event', | |
'count' : {$sum : 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
..... | |
//this filters result of the query, then apply aggregations on terms. | |
//if you want to filter result of the aggregation you will need reducers | |
//https://github.com/elasticsearch/elasticsearch/issues/8110 | |
.Aggregations(a1 => a1 | |
.Filter("filter", fd => fd.Filter(f => | |
f.Regexp(f3 => f3 | |
.OnField(d => d.MdFacets) | |
.Value(parameters.FacetName + @"\|.*")) |
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
/// <summary> | |
/// returns a lambda function that compose query in And or Or | |
/// </summary> | |
/// <param name="parameters"></param> | |
/// <returns></returns> | |
private static Func<QueryContainer, QueryContainer, QueryContainer> GetQueryComposer(QueryTypeEnum queryType) | |
{ | |
Func<QueryContainer, QueryContainer, QueryContainer> composer = (q1, q2) => q1 || q2; | |
if (queryType == QueryTypeEnum.And) | |
composer = (q1, q2) => q1 && q2; |
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
[diff] | |
tool = vsdiffmerge | |
[difftool] | |
prompt = true | |
[difftool "vsdiffmerge"] | |
cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t | |
keepbackup = false | |
trustexistcode = true | |
[merge] | |
tool = vsdiffmerge |
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
Vagrant.configure(2) do |config| | |
config.vm.box = "tomassrnka/trusty64" | |
config.vm.hostname = "graylog" | |
config.vm.network :forwarded_port, guest: 9000, host: 9000 | |
config.vm.network :forwarded_port, guest: 12900, host: 12900 | |
config.vm.network :forwarded_port, guest: 12201, host: 12201, protocol: 'udp' | |
config.vm.network :forwarded_port, guest: 12201, host: 12201, protocol: 'tcp' | |
config.vm.provider "hyperv" do |v| |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<meta-runner name="GitVersion"> | |
<description>Execute GitVersion</description> | |
<settings> | |
<parameters> | |
<param name="mr.GitVersion.gitCheckoutDir" value="" spec="text description='The directory containing .git relative to the working directory. Leave blank for the working directory itself.' display='normal' label='Git Repository Directory:'" /> | |
<param name="mr.GitVersion.output" value="buildserver" spec="checkbox checkedValue='buildserver' description='Update the TeamCity build number or output JSON?' display='normal' label='Update TeamCity build version:' uncheckedValue='json'" /> | |
<param name="mr.GitVersion.outputFile" value="" spec="text description='Optional path to a file relative to the working directory to output the json into if you selected JSON above.' display='normal' label='Json output file:'" /> | |
<param name="mr.GitVersion.url" value="" spec="text description='Optional URL to remote git repository if you have not already checked o |
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.getCollection('Commits').aggregate([ | |
{$unwind : "$Events"}, | |
{$project : {"Events.Payload.Body._t" : 1, _id : -1}}, | |
{$group : {_id : "$Events.Payload.Body._t" , count : {$sum : 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
tags = []; | |
[1,2,3,4].forEach(function(num) | |
{ | |
tags.push(''+num); | |
db.SampleData.insert({ | |
num: NumberInt(num), | |
tags:tags | |
}) | |
}) |
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
[diff] | |
tool = vsdiffmerge | |
[difftool] | |
prompt = true | |
[difftool "vsdiffmerge"] | |
cmd = \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\IDE\\vsdiffmerge.exe\" \"$LOCAL\" \"$REMOTE\" //t | |
keepbackup = false | |
trustexistcode = true | |
[merge] | |
tool = vsdiffmerge |
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
var dbs = db.getMongo().getDBNames() | |
for(var i in dbs){ | |
db = db.getMongo().getDB( dbs[i] ); | |
if (db.getName().startsWith('blah')) | |
{ | |
print( "dropping db " + db.getName() ); | |
db.dropDatabase(); | |
} | |
} |
OlderNewer