![Introducing Dashboard Analytics](https://cdn.sanity.io/images/cgdhsj6q/production/af327c5bd94708db501516a75da6870aef894c64-2286x1522.png?w=400&fit=max&auto=format)
Product
Introducing Dashboard Analytics
We're introducing a new Analytics feature in the Socket dashboard so you can view changes in your organization's and repositories' alerts over time.
@syncfusion/ej2-data
Advanced tools
@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.
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);
Lodash is a popular utility library that provides a wide range of functions for manipulating arrays, objects, and other data types. It offers similar functionalities to @syncfusion/ej2-data, such as sorting, filtering, and aggregating data. However, Lodash is more general-purpose and not specifically designed for integration with UI components.
Underscore is another utility library that provides functional programming helpers for working with arrays, objects, and other data types. Like Lodash, it offers functionalities similar to @syncfusion/ej2-data, including sorting, filtering, and grouping. Underscore is known for its simplicity and ease of use.
RxDB is a real-time NoSQL database for JavaScript applications. It provides data management capabilities, including querying, sorting, and filtering, similar to @syncfusion/ej2-data. RxDB is designed for offline-first applications and supports real-time data synchronization.
@syncfusion/ej2-data
is a data management package to perform data operations such as grouping, sorting in client applications.
It will act as an abstraction for using local data sources like array of JavaScript objects
and remote data sources like web services returning JSON, JSONP, oData or XML.
FAQs
Essential JS 2 DataManager
The npm package @syncfusion/ej2-data receives a total of 122,423 weekly downloads. As such, @syncfusion/ej2-data popularity was classified as popular.
We found that @syncfusion/ej2-data demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Product
We're introducing a new Analytics feature in the Socket dashboard so you can view changes in your organization's and repositories' alerts over time.
Security News
A new OpenSSF report uncovers critical gaps in secure software training, with 75% of new developers unfamiliar with secure practices, highlighting urgent educational needs.
Security News
The 2023 Python Developers Survey reveals key trends in packaging, web frameworks, and developer demographics, highlighting a shift toward innovative tools as the Python community diversifies and grows among less experienced developers.