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
0
votes
2 answers

Linq JS. How to group by repeated?

I am trying to use linqJS with the following array of objects: var foo = [ { id: 1234, index: 0, }, { id: 1234, index: 1, }, { id: 5678, index: 2, }, { id: 9123, …
asterk-7g
  • 201
  • 1
  • 2
  • 5
0
votes
1 answer

Translate a LINQ query to LINQJS

How would you translate this query: var groups = visibleDateRange.select((date, index) => new { Date = date, Index = index }) .GroupBy(p => p.Index / 3); to a javascript linqJS query? All the linqJS samples are…
Pascal
  • 12,265
  • 25
  • 103
  • 195
0
votes
1 answer

Inner join with linqJS

I create a dateRange wich is an array of dates. Then I have an array of day numbers like 0 for Sunday, 1 for Monday etc... Now I want to get all dateRange dates according to the visibleWeekDays array. The solution is in the getVisibleDateRange…
Pascal
  • 12,265
  • 25
  • 103
  • 195
0
votes
1 answer

Using Linq.js with Durandal/Require.js

I have done the following setup: Added the following script tag: Configure linq.js in the main.js requirejs.config({ paths: { 'text': '../Scripts/text', 'durandal': '../Scripts/durandal', …
Alwyn
  • 8,079
  • 12
  • 59
  • 107
0
votes
2 answers

My LINQ count query returns the wrong result

I'm using linq.js to use LINQ in my JavaScript code. When trying to filter out an array, I'm getting a bogus output. What am I doing wrong? Code: console.log($.Enumerable.From(streams.Medias["User Feeds"][a].Streams).Where('x => x.Name.length >…
Lexious
  • 13
  • 1
  • 10
0
votes
1 answer

javascript linq.js groupby

I have the following JSON data in a Javascript function (it's simplified here): var data = [ { Expiry: "2013-01-02T00:00:00", EndDate: "2013-01-16T00:00:00", Category: 10, Amount: 14.53 }, { Expiry: "2013-01-02T00:00:00", EndDate:…
trembler2003
  • 559
  • 2
  • 8
  • 16
0
votes
2 answers

Joins and Aggregates in Javascript Arrays

I have been trying for hours to do this using json.js but is just too much for something that seems simple. I have this example data: var hotels = [ { id: 101, Name: "Hotel 101", WebFacilities: [8, 9, 10] }, { id: 102, Name:…
Carlos Martinez T
  • 6,458
  • 1
  • 34
  • 40
0
votes
1 answer

In JavaScript using both linq.js and knockout.js, how can I generate an observableArray that contains a computed property?

Sorry if my title makes no sense but this is what I've gotten down to so far: function createPostsArray(last) { var postArr = generate( function () { return {…
egucciar
  • 2,039
  • 6
  • 23
  • 24
-1
votes
1 answer

How to find most common number in array using link in JavaScript?

I want find most common element in array using link in JavaScript. I have solution with loop, and it works good, but I need something shorter. I tried do solution with orderBy, count, key, orderByDescending link methods, but it not work. Any ideas?…
MrRagn
  • 7
  • 1
-1
votes
3 answers

Filter Sub array

i am trying to filter my array which has a sub array. i want to filter my array by sub array my array looks like this: var Branches = [ { Name: 'branch1', Screens: [ { …
-1
votes
1 answer

How can i make a linq

var adreees = Variables.PolicyCustomerAddresses; var linq= Enumerable.From(adreees) .Where(linq.CUSTOMER_ADRESS_ID === correspondenceAdress && linq.CUSTOMER_ID === customerCode) .DefaultIfEmpty(null) …
Mustafa
  • 63
  • 11
-1
votes
1 answer

"any of list" selector in LINQ.JS

I'm looking for something like SQL "in" operator in LINQ.JS. Consider below array: var fruits = [ {name:"apple" , color:"red" } {name:"banana" , color:"yellow" } {name:"cucumber" , color:"green" } {name:"cherry" …
Behnam
  • 1,039
  • 2
  • 14
  • 39
-1
votes
1 answer

how to convert array of arrays to array of objects

I am trying to create a json file to test out some react-native map polygon functionality. I have geoJson available from a project using leaflet maps. I need to format the lat/lng points. I have drilled down from the top level-geometry-coordinates.…
texas697
  • 5,609
  • 16
  • 65
  • 131
-1
votes
1 answer

How to convert this cycle into Linq.js or just linq

My code is written in JavaScript for (var i = 0; i < tsUA.length; i++) { if (tsRU[i][0] === tsUA[i][0]) tsUA[i][2] = tsRU[i][1]; } preferably using firstOrDefault
-1
votes
1 answer

Calculating averages of groups of data

I am trying to configure a reporting tool for resource planning. I have one JSON object that contains information about my periods(weeks) and a person's role/experience(numeric) in that period. I have two persons, Dave and Jim. In period 1(week 1)…
Ben Irving
  • 461
  • 1
  • 6
  • 21