Nancy Den

Nancy Den

179 Articles Published

Articles by Nancy Den

Page 6 of 18

Get names of all keys in the MongoDB collection?

Nancy Den
Nancy Den
Updated on 14-Mar-2026 2K+ Views

Since MongoDB documents can have different structures (no fixed schema), getting all key names requires iterating over documents. There are multiple approaches depending on whether you need keys from one document or all documents. Method 1: Using JavaScript Loop (Single Document) Use findOne() to get a document and loop through its keys ? var doc = db.studentGetKeysDemo.findOne(); for (var key in doc) { print(key); } Sample Data db.studentGetKeysDemo.insertOne({ "StudentId": 1, "StudentName": "Larry", "StudentAge": 23, ...

Read More

How to query MongoDB with LIKE?

Nancy Den
Nancy Den
Updated on 14-Mar-2026 3K+ Views

MongoDB does not have a LIKE operator like SQL. Instead, use regular expressions (regex) or the $regex operator for pattern matching. Syntax // Using regex literal (equivalent to SQL LIKE '%value%') db.collection.find({"field": /.*value.*/}) // Using $regex operator db.collection.find({"field": {$regex: "value", $options: "i"}}) Create Sample Data db.employee.insertMany([ {"EmployeeName": "John", "EmployeeSalary": 450000}, {"EmployeeName": "Carol", "EmployeeSalary": 150000}, {"EmployeeName": "James", "EmployeeSalary": 550000}, {"EmployeeName": "Jace", "EmployeeSalary": 670000}, {"EmployeeName": "Larry", "EmployeeSalary": 1000000} ]); Query with "like" ...

Read More

Find objects between two dates in MongoDB?

Nancy Den
Nancy Den
Updated on 14-Mar-2026 3K+ Views

Use the $gte (greater than or equal) and $lt (less than) operators with ISODate() to find documents between two dates in MongoDB. Create Sample Data db.order.insertMany([ {"OrderId": 1, "OrderAddress": "US", "OrderDateTime": ISODate("2019-02-19")}, {"OrderId": 2, "OrderAddress": "UK", "OrderDateTime": ISODate("2019-02-26")}, {"OrderId": 3, "OrderAddress": "IN", "OrderDateTime": ISODate("2019-03-05")} ]); Find Between Two Dates Find orders between Feb 10 and Feb 21 ? db.order.find({ "OrderDateTime": { $gte: ISODate("2019-02-10"), ...

Read More

ABAP constants with %_ as prefix

Nancy Den
Nancy Den
Updated on 13-Mar-2026 455 Views

The constants with a value of %_ as prefix are defined in ABAP for its internal use of the system. These need to be used as such and cannot be modified by the user. Understanding %_ Prefixed Constants In ABAP, constants that begin with %_ are system-reserved constants used internally by the SAP system. These constants serve specific purposes within the ABAP runtime environment and various system components. Key Characteristics The %_ prefixed constants have the following important characteristics − Read-only − They cannot be modified or redefined by developers ...

Read More

Creating a table in SAP system using OData service

Nancy Den
Nancy Den
Updated on 13-Mar-2026 907 Views

In order to create a table in an SAP system using OData service, you need to use either *.hdbdd or *.hdbtable files to define your table structure and then expose them with xsodata service definition. The .hdbdd file uses Core Data Services (CDS) syntax for defining database objects, while .hdbtable uses native SQL DDL syntax. Once your table is created, the .xsodata file exposes it as an OData service endpoint. Creating OData Service Definition To expose your table through OData, create a service definition file with the .xsodata extension. The basic syntax includes the service namespace and ...

Read More

Getting day of the year from DD/MM/YYYY using function in SAP system

Nancy Den
Nancy Den
Updated on 13-Mar-2026 748 Views

In SAP systems, you can calculate the day of the year from a DD/MM/YYYY date using a simple function. The day of the year represents which day number it is within that specific year (1-366). You can achieve this with the following line of code − DATA(l_day) = m_date - CONV d(m_date(4) && '0101' ) + 1. Where m_date is the input date that needs to be of type d. Note that the format of type d is YYYYMMDD. This code works by: Extracting the year from the input ...

Read More

Naming conflict error while consuming SAP Web Service in .net

Nancy Den
Nancy Den
Updated on 13-Mar-2026 257 Views

When consuming SAP Web Services in .NET applications, naming conflicts can occur due to overlapping system namespaces between BAPI and Windows frameworks. This typically happens when both environments use similar class or method names, causing ambiguity during compilation. You can fix this issue by adding Global before all calls giving the error. This has happened because of system namespace conflicts in BAPI and Windows. Solution 1: Using Global Namespace Add the global:: prefix to explicitly reference the global namespace − ...

Read More

Call event function from another method in Controller in SAP

Nancy Den
Nancy Den
Updated on 13-Mar-2026 739 Views

It is advised not to call the event function from any other function but what you can do is refactor the event function implementation in a separate function and call that from any other function as shown below − Best Practice Approach The recommended approach is to create a helper function that contains the actual logic, and then call this helper function from both the event handler and any other methods that need the same functionality. This maintains clean separation of concerns while avoiding direct event function calls. Example Here's how to implement this pattern in ...

Read More

Bootstrap 3 truncate long text inside rows of a table in a responsive way with HTML

Nancy Den
Nancy Den
Updated on 13-Mar-2026 1K+ Views

To truncate long texts inside rows of a table in a responsive way using Bootstrap 3, we need to combine CSS properties that control text overflow with Bootstrap's responsive grid system. This approach ensures that long text content is properly truncated with ellipsis (...) when it exceeds the available space. CSS for Text Truncation Use the following CSS to create responsive text truncation − .table td.demo { max-width: 177px; } .table td.demo span { overflow: hidden; text-overflow: ellipsis; display: ...

Read More

Remember and Repopulate File Input in HTML5

Nancy Den
Nancy Den
Updated on 12-Mar-2026 412 Views

Browsers do not allow you to programmatically set the value of a file for security reasons. This means you cannot "remember" a previously selected file and repopulate the input on page reload using JavaScript alone. However, HTML5 introduced the Drag and Drop API along with the DataTransfer object, which provides a workaround − users can drag files onto a drop zone, and your code can process those files just like a file input would. How Drag and Drop Works with Files When a user drops a file onto a designated area, the browser fires a drop event. The dropped ...

Read More
Showing 51–60 of 179 articles
« Prev 1 4 5 6 7 8 18 Next »
Advertisements