Questions tagged [linq.js]

An implementation of List and Sequence operations for JavaScript, as inspired by .NET's Language INtegrated Query (LINQ).

LINQ.js

This project is an implementation of List and Sequence operations for JavaScript, as inspired by .NET's Language INtegrated Query (LINQ).

Features

  • All .NET 4.0 methods and many extras (with inspiration from Rx, Achiral, Haskell, Ruby, etc...)
  • Complete lazy evaluation
  • Full IntelliSense support for VisualStudio
  • Two versions - linq.js and jquery.linq.js (jQuery plugin)
  • Support Windows Script Host
  • Binding for Reactive Extensions for JavaScript(RxJS) and IntelliSense Generator -> see documentation
  • NuGet packages: linq.js, linq.js-jQuery, linq.js-Bindings

See or MSDN for more information regarding LINQ itself.

LINQ.js official website: http://linqjs.codeplex.com/

108 questions
2
votes
2 answers

Linq.Js Group By with Count

I have the following array: var data= [{ "Id": 1, "Name": "NameOne"} { "Id": 2, "Name": "NameTwo"} { "Id": 2, "Name": "NameTwo"}] { "Id": 3, "Name": "NameThree"}] Using linq.js I would like to return the…
nav
  • 509
  • 4
  • 19
2
votes
1 answer

linq.js using group by on multiple fields

I currently have an array of objects such as [{Test: "123", Two: "234"}, {Test: "123", Two: "234"}, {Test: "123", Two: "222"}] Using linq.js how would I be able to run a group by and return a list that returns the count of the duplicate (test,two)…
nav
  • 509
  • 4
  • 19
2
votes
2 answers

linq.js groupby with Json

This is my Json Object in simplified form. var jsonObject = [ {"City":"Monroe","Country":"USA","Latitude":47.8524,"Longitude":-121.98151}, {"City":"Austin","Country":"USA","Latitude":30.40137,"Longitude":-97.73542}, …
Raza
  • 807
  • 1
  • 9
  • 16
2
votes
2 answers

Select two fields out of three fields from Json data using Linq.js

I need to select two fields out of three fields from Json data using Linq.js Required output should be [{ "A": -27, C: "country 1" } , { "A": 28 , C: "country 2"} ] using "linq.js" from following path: […
irfan Munir
  • 151
  • 3
  • 17
1
vote
2 answers

Linq Help need to convert to Linq Object model from sql model

I have the following Linq, from x in Enumerable.Range(refx - 1, 3) from y in Enumerable.Range(refy - 1, 3) where (x >= 0 && y >= 0) && (x < array.GetLength(0) && y < array.GetLength(1)) && !(x == refx && y == refy) select new Location(x,y) I…
user677607
1
vote
1 answer

How to use SelectMany in typescript

I am getting this error and I am not sure why. I see that the this.dayscalendar.Days is a array with data. I am trying to use the SelectMany and select the one record that matches. linq.js:1521 Uncaught Error: Single:No element satisfies the…
Jefferson
  • 173
  • 2
  • 12
  • 32
1
vote
1 answer

npm linq: Grouping Multiple columns

I am trying to group by 2 columns in an array of objects and get a grouped sum total of a value. i have been using linq for this and this is the code: import Enumerate from "linq"; let data = [ { Phase: "Phase 1", Step: "Step 1", Task: "Task 1",…
Ben Quan
  • 773
  • 11
  • 25
1
vote
1 answer

GroupBy with LinqTS(Typescript)

I am using LINQTS to have some information from via grouping some data. const registered_users_data = listData .groupBy( b => moment(b.created_at).format('YYYY/MM') ) .select(x => { x.key, x.value.count(); }) .toArray(); For…
Manoj Sethi
  • 1,898
  • 8
  • 26
  • 56
1
vote
1 answer

linqts - group by multiple properties

I have an array of JSON objects which have to be grouped by multiple properties. const JSON_DATA = [ {"componentName":"CP1","articleNumber":"441","componentType":"Ext","version":"V1.1.6"}, …
StV
  • 169
  • 1
  • 2
  • 8
1
vote
1 answer

linq.js is modifying my source when I use Where()

I'm using linq.js against a JSON array that I get passed from MVC. It looks kind of like this.. [{ClAccountNumber : "101" Roles : {blahblahblah}},{ClAccountNumber : "102", Roles : {blahblahblah}}] The problem I'm having is when I use the…
Shane Courtrille
  • 13,960
  • 22
  • 76
  • 113
1
vote
4 answers

Filter one array using values from another array using linqjs

The first one is an array of objects: let objectArray = [{ FullName: "Person1", PersonId: "id1" }, { FullName: "Person2", PersonId: "id2" }, { FullName: "Person3", PersonId: "id3" }, { FullName: "Person4", …
goediaz
  • 622
  • 6
  • 19
1
vote
1 answer

linq,js GroupBy coordinates(lat, lng)

I have the following array: var coord = [ {flat:"7", house:"14", indication1: "60", lat: "47.93896450", lng:"33.43282100"}, {flat:"9", house:"18", indication1: "65", lat: "47.87736800", lng:"33.27488850"}, {flat:"10", house:"14", indication1: "24",…
NisuSan
  • 197
  • 1
  • 13
1
vote
1 answer

linq.js unexpected results

Okay, so I have got this JSON object called…
Basvo
  • 156
  • 2
  • 19
1
vote
2 answers

Removing element from object array with linq.js

I have started using linq.js a while ago, and found it very useful, but there's an issue I really can't solve somehow. I'm using angular, and I have a simple json array with the following structure: [ { id: 1, name: 'John', age: 20}, { id: 2,…
Kiss Koppány
  • 919
  • 5
  • 15
  • 33
1
vote
2 answers

Converting a linq-query to linqjs

Been trying to learn LinQJS from some while now by converting some old Linq-querys to LinqJs-query. This is the Linq-query. (from y in class1 join x in class2 on y.Id equals x.Name group y by new { y.Date, x.Number } into xy select new class3() …