Skip to content

Instantly share code, notes, and snippets.

@alexhogak
Created May 10, 2016 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexhogak/b2f4f0e5d19ca3c6b81a4c39378acc7d to your computer and use it in GitHub Desktop.
Save alexhogak/b2f4f0e5d19ca3c6b81a4c39378acc7d to your computer and use it in GitHub Desktop.
MONGO UNWIND EXAMPLE
db.newwolverhampton.aggregate([{$unwind: "$Appeals"},{$project: {_id: 0, BAReference: 1, Postcode: 1, EffectDate: 1, TotalArea: 1, BillingAuthority: 1, RateableValue: 1, Address: 1, Description: 1, Appeal_Reference: "$Appeals.ReferenceNo", Appeal_Applicant: "$Appeals.Applicant", Appeal_Agent: "$Appeals.Agent", Grounds: "$Appeals.Grounds_for_Appeal", Appeal_Start: "$Appeals.Start_Date", Appeal_End: "$Appeals.End_Date", Appeal_Settlement: "$Appeals.Settlement"}},{$out: "newwolvesappeals"}])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment