Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@syncfusion/ej2-data

Package Overview
Dependencies
Maintainers
3
Versions
171
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@syncfusion/ej2-data

Essential JS 2 DataManager

  • 20.3.60
  • npm
  • Socket score

Version published
Weekly downloads
128K
decreased by-13.34%
Maintainers
3
Weekly downloads
 
Created

What is @syncfusion/ej2-data?

@syncfusion/ej2-data is a data management package that provides a set of utilities for handling data operations such as sorting, filtering, grouping, and querying. It is part of the Syncfusion Essential JS 2 suite and is designed to work seamlessly with other Syncfusion components.

What are @syncfusion/ej2-data's main functionalities?

DataManager

The DataManager feature allows you to manage and manipulate data collections. In this example, a DataManager instance is created with a sample data array, and a query is executed to filter out records where the age is greater than 28.

const { DataManager, Query } = require('@syncfusion/ej2-data');

const data = [
  { id: 1, name: 'John', age: 30 },
  { id: 2, name: 'Jane', age: 25 },
  { id: 3, name: 'Doe', age: 35 }
];

const dataManager = new DataManager(data);
const query = new Query().where('age', 'greaterThan', 28);
const result = dataManager.executeLocal(query);
console.log(result);

Sorting

The Sorting feature allows you to sort data collections based on specified fields. In this example, the data is sorted by the 'name' field in ascending order.

const { DataManager, Query } = require('@syncfusion/ej2-data');

const data = [
  { id: 1, name: 'John', age: 30 },
  { id: 2, name: 'Jane', age: 25 },
  { id: 3, name: 'Doe', age: 35 }
];

const dataManager = new DataManager(data);
const query = new Query().sortBy('name', 'ascending');
const result = dataManager.executeLocal(query);
console.log(result);

Grouping

The Grouping feature allows you to group data collections based on specified fields. In this example, the data is grouped by the 'group' field.

const { DataManager, Query } = require('@syncfusion/ej2-data');

const data = [
  { id: 1, name: 'John', age: 30, group: 'A' },
  { id: 2, name: 'Jane', age: 25, group: 'B' },
  { id: 3, name: 'Doe', age: 35, group: 'A' }
];

const dataManager = new DataManager(data);
const query = new Query().group('group');
const result = dataManager.executeLocal(query);
console.log(result);

Aggregates

The Aggregates feature allows you to perform aggregate operations like sum, average, min, and max on data collections. In this example, the sum of the 'age' field is calculated.

const { DataManager, Query, DataUtil } = require('@syncfusion/ej2-data');

const data = [
  { id: 1, name: 'John', age: 30 },
  { id: 2, name: 'Jane', age: 25 },
  { id: 3, name: 'Doe', age: 35 }
];

const dataManager = new DataManager(data);
const query = new Query().select(['age']);
const result = dataManager.executeLocal(query);
const totalAge = DataUtil.aggregates.sum(result, 'age');
console.log(totalAge);

Other packages similar to @syncfusion/ej2-data

FAQs

Package last updated on 06 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc