yocontra / node-linq

LINQ for node
http://wearefractal.com/
MIT License
77 stars 7 forks source link

Distinct not working #13

Open heliobarbosa opened 5 years ago

heliobarbosa commented 5 years ago

I have this example code below:

var LINQ = require('node-linq').LINQ;
var meuarr = [ 
{ 
    _REG: '0',
    _NUMERO: '000000000000',    
    _UF: 'SP',    
    _REFERENCIA: '201707'
},
{ 
    _REG: '1',
    _NUMERO: '995487',    
    _UF: 'SP',    
    _REFERENCIA: '201707'    
}
];
var arr = new LINQ(meuarr)                 
    .OrderBy(function(linha){return linha._REFERENCIA})                           
    .Select(function(linha){return {UF:linha._UF,REFERENCIA:linha._REFERENCIA}})                             
    .Distinct()                        
    .ToArray();
console.log(arr);

but I am faced by this error below: image