Posts

MongoDB Exercise :2

 studentsB> db.aids.find().count() 4 studentsB> db.aids.find().count() 4 studentsB> db.aids.find().limit(3) [   {     _id: ObjectId("66fa2428ca0fc631a23b264f"),     SRN: 201,     SName: 'A',     yr: 3   },   {     _id: ObjectId("66fa2479ca0fc631a23b2650"),     SRN: 202,     SName: 'B',     yr: 3   },   {     _id: ObjectId("66fa249eca0fc631a23b2652"),     SRN: 303,     SName: 'CC',     yr: 3   } ] studentsB> db.aids.find().limit(2) [   {     _id: ObjectId("66fa2428ca0fc631a23b264f"),     SRN: 201,     SName: 'A',     yr: 3   },   {     _id: ObjectId("66fa2479ca0fc631a23b2650"),     SRN: 202,     SName: 'B',     yr: 3   } ] studentsB> db.aids.find().sort() [   {     _id: ObjectId("66fa2428ca0fc631a23b264f"), ...

Create and drop database and collection

  In MongoDB, you can drop a database using the db.dropDatabase() method, and you can drop a collection using the db.collection.drop() method. Here's how you can use these commands: Drop a Collection : To drop a specific collection in MongoDB, you can use the db.collection.drop() method. Replace collection with the name of the collection you want to drop. Here's an example: use your_database_name // Switch to the appropriate database db.your_collection_name.drop() Replace your_database_name with the name of your database and your_collection_name with the name of the collection you want to drop. Drop a Database : To drop an entire database in MongoDB, you can use the db.dropDatabase() method. Be very careful when using this command because it will permanently delete the entire database and all its collections. use your_database_name // Switch to the appropriate database db.dropDatabase()

MongoDB Insert, find, update and delete

 abc123> db.eswar.insertOne({SRN:001,SName:'a',yr:3}) {   acknowledged: true,   insertedId: ObjectId("66f392b1d8b1cbf0117c527c") } abc123> db.eswar.insertOne({SRN:002,SName:'b',yr:3}) {   acknowledged: true,   insertedId: ObjectId("66f392cbd8b1cbf0117c527d") } abc123> db.eswar.insertOne({SRN:003,SName:'c',yr:2}) {   acknowledged: true,   insertedId: ObjectId("66f392e3d8b1cbf0117c527e") } abc123> db.eswar.find() [   {     _id: ObjectId("66f392b1d8b1cbf0117c527c"),     SRN: 1,     SName: 'a',     yr: 3   },   {     _id: ObjectId("66f392cbd8b1cbf0117c527d"),     SRN: 2,     SName: 'b',     yr: 3   },   {     _id: ObjectId("66f392e3d8b1cbf0117c527e"),     SRN: 3,     SName: 'c',     yr: 2   } ] abc123> show collections eswar abc123> db.eswar.update({SName:'C'},{$set:{yr:3}}) DeprecationWarni...

Mean stack status

 https://docs.google.com/forms/d/e/1FAIpQLSdBj6rR-vVcndcBeALeNEZuG3clwekFdMr71imXZbdQhYz9qA/viewform?usp=sharing

Different paranthesis ( ), [ ], [ ( ) ], { } used in Angular and their meanings

 In Angular, different types of brackets are used for various purposes in templates to handle data binding and structural directives. Here’s a breakdown of how each type of bracket is used: 1. Parentheses () Purpose : Used for event binding. Usage : When you want to handle events such as clicks, changes, or any other DOM events, you use parentheses. <button (click)="handleClick()">Click me</button> Here, (click) is the event binding that calls the handleClick() method in the component when the button is clicked. 2. Square Brackets [] Purpose : Used for property binding. Usage : When you want to bind a property of an HTML element to a component property, you use square brackets. Example: <img [src]="imageUrl" /> In this case, [src] binds the src attribute of the <img> element to the imageUrl property in the component. 3.  Both Square and Parentheses [( )] Purpose : Used for two-way data binding. Usage : This combines property binding and...

Modules, Components, Templates in Angular and the relation among them....

 The relationship between modules, components, and templates in an Angular application is fundamental to how Angular applications are structured and operate. Here's how they relate to each other: 1. Modules : Definition : A module is a container that groups together related components, directives, pipes, and services. It serves as an organizational unit within the Angular application. Purpose : Modules help manage the dependencies between different parts of the application and facilitate features like lazy loading, where certain parts of the application are loaded only when needed. 2. Components : Definition : A component is a building block of the UI in an Angular application. Each component consists of: A TypeScript class that contains the logic. A template that defines the view (usually an HTML file). Styles (optional) to define the look of the component. Purpose : Components are responsible for rendering the UI and handling user interactions. They interact with services to p...

9. Angular and MongoDBs

Angular and MongoDBs 1.       Angular Application Setup Observe   the   link   http://localhost:4200/welcome   on   which   the   mCart   application   is   running.     2.       Components   and   Modules Create   a   new   component   called   hello   and   render   Hello   Angular   on   the   Page   3.       Elements   of   Template Add   an   event   to   the   hello   component   template   and   when   it   is   clicked,   it   should   change the   courseName.   4.       ngFor Create a courses array and rendering it in the template using ngFor directive in a list format   5.       ngClass Ap...