Skip to content

Instantly share code, notes, and snippets.

View nickchampion's full-sized avatar

Nick Champion nickchampion

View GitHub Profile
@nickchampion
nickchampion / gist:8596155
Last active January 4, 2016 08:29
RavenDB Lookup Value From Dictionary On Related Document With Int Key From Within Index Definition
[TestFixture]
public class FailingTest : RavenTestBase
{
[Test]
public void LookupValueFromDictionaryOnRelatedDocumentWithIntKey()
{
using (var store = NewDocumentStore())
{
using (var session = store.OpenSession())
{
@nickchampion
nickchampion / CanAggregateByMinAndMaxOnSameField
Created February 27, 2015 10:44
Can Aggregate By Min And Max On Same Field
using System.Collections.Generic;
using System.Linq;
using Raven.Abstractions.Data;
using Raven.Abstractions.Indexing;
using Raven.Client;
using Raven.Client.Indexes;
using Raven.Tests.Helpers;
using Xunit;
namespace Marketplace.Tests.Unit.RavenDb
@nickchampion
nickchampion / Transformer Compilation Failing Test
Created September 3, 2015 13:42
RavenDB Transformer Compilation Failing Test
using System.Collections.Generic;
using System.Linq;
using Raven.Client.Indexes;
using Raven.Tests.Helpers;
using Xunit;
namespace Marketplace.Tests.Unit.RavenDb
{
public class FailingRavenTests : RavenTestBase
{
@nickchampion
nickchampion / gist:28126e1c5942e5c5da3332868d96598e
Last active June 26, 2016 09:36
RavenDB Failing test serialisation
using System;
using System.Collections.Generic;
using NUnit.Framework;
using Raven.Abstractions.Cluster;
using Raven.Abstractions.Replication;
using Raven.Client;
using Raven.Client.Document;
using Raven.Client.UniqueConstraints;
using Raven.Tests.Helpers;
public IDocumentStore Create()
{
var store = new DocumentStore
{
Url = BootstrapConfiguration.DatabaseUrl,
ApiKey = BootstrapConfiguration.WebClientDatabaseApiKey,
ResourceManagerId = _resourceManagerId,
EnlistInDistributedTransactions = false,
Conventions =
{
using System;
using NUnit.Framework;
using Raven.Abstractions.Replication;
using Raven.Client;
using Raven.Client.Document;
namespace Marketplace.Tests.Unit
{
[TestFixture]
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using Raven.Tests.Helpers;
namespace Marketplace.Tests.Unit.RavenDb
{
[TestFixture]
public class FailingRavenTests : RavenTestBase
{
@nickchampion
nickchampion / dedupe.js
Created April 1, 2022 08:12
De-dupe Groups
db.groups.deleteMany({'flags.system': true})
db.organisations.find({ name: 'FarmTo' }).forEach((org) => {
db.groups.insert({
organisation: org._id,
name: "INTERNAL",
services: {
default: 31,
logistics: 31,
inventory: 31,
@nickchampion
nickchampion / inventory_search.json
Last active May 16, 2022 07:23
Inventory Search JSON
{
"totalDocs": 2,
"limit": 25,
"offset": 0,
"elasped": 0,
"docs": [
{
"tags": [
"jims farm"
],
[
{
"items": [
{
"name": "Wheat",
"types": [
{
"id": 9,
"name": "Winter Wheat"
},