Skip to content

Instantly share code, notes, and snippets.

View Abhinay-g's full-sized avatar
🎯
Focusing

Abhinay Abhinay-g

🎯
Focusing
  • ABB
  • India
View GitHub Profile
@Abhinay-g
Abhinay-g / MongoDB reading data
Last active April 24, 2019 13:23
MongoDB reading data
>Intorduction
This module will consist of following
1) methods, Filters and Operators for Reading Data
2) query selector
3) Projection operator
>Operators
All command include a db.collectionName.MethodName({-parameter-})
parameter can be key value pair or it could be a Range
db.collectionName.MethodName({key:{$operator:value}})
@Abhinay-g
Abhinay-g / Mongo DB Create operation
Last active April 18, 2019 07:24
Mongo DB Create operation
> Introduction
This module based on data creating , Data can be crated on mongodb , or it can be imported from other source
We will learn about insert method and different ways of importing data into mongo DB
> Insert methods
ther eare 3 mthods
1 ) insertOne({}) this will take one documetns
2 ) insertMany({}) this tail ltake multiple documents
3 ) insert() It takes both single/ multiple documents
@Abhinay-g
Abhinay-g / MongoDB Schema design
Last active April 18, 2019 05:32
MongoDB Schema design
> Introductions
when working with project we need to find what kind of structure of our data, what will be ralation between our data
We will udnerstand ducuments and other types of data
we a will also look into diffreent type of relation, And we will Validate the Data [Schema validation]
>Schema
Mongo DB supposed to be a schemaless DB but why there is a schema, well MongoDB do not enforce schema as
it is enforced by RELATIONAL database. hance creating a schema is an option and as per developers need
It is totally developer oriented we can follow any approch, we can forefully insert value by assigninign
null to that extra field
@Abhinay-g
Abhinay-g / MongoDB
Last active April 16, 2019 09:12
MongoDB
> intorductioon
mongod is a database server , this should be up and running
mongod --port = PORT will be running mongo server on perticular server
mongo is a mongoDB shell , this is used to do all mongo operation , thought we haave DRIVERS for all kind of platform
Shell command are almost similar as JAVAscript driver for nodejs
show dbs > show databases
use DataBase_name > create a database
db.collectionName.insertOne({JSON_Document}) > create a collection and inserting a document into it
@Abhinay-g
Abhinay-g / Angular Artifacts for Forms
Last active April 9, 2019 11:32
Angular Artifacts for Forms
> Why agnular forms :
Angualr form gives key-value object of a form which can be used for multiple purpose .
Agnular also give a metadata related to forms.
In traditional HTML form we have action="somefunction()" and method="get!post" , but when we use it with angular we do not specify
anything to angular, angular itself treat <form> as some kind of directive|compoenent and act on it using formsModule.
> Types of angular forms
Template Driven From : in this template is fixed and form element is accessed on TS {So angular infer form from DOM side}
Reactive Form : in this form configuration is done on TS file Also on TEMPLATE side {form created dynamically and synced with DOM}
@Abhinay-g
Abhinay-g / Angular Artifacts for Services and DI
Last active April 3, 2019 12:30
Angular Artifacts for Services and DI
>Services
Services are used to share common logic among set ot multiple component.
So a Service can containe a buisness logic or it can containe call to API
Services can be used for [logging], for [Data storage].
>Adding service
To added service we need to load the service into constructor and to Providers array in @Component({}) directive
>Hirachical Injector
>introduction Directive
Attribute and Structural directive
[No Dom change] [Dom Change]
Why cant we add multiple directive on same element like we can not use ngIf and ngFor on same element
> Gettting started with Directive
create a class with @Directive Devorator and [selector] as a paramter to decorator
using elementRef to change to style of an element
Note: Remember changing element style using [element.nativeElement.style.backgrroundColor] may not be available because Angular can render
@Abhinay-g
Abhinay-g / Angular Artifacts
Last active April 2, 2019 10:39
For DataBinding
> property and event binding
In angular property and event binding is used to transfer data acreoss compoenent
This is the best approch for transferring data
if sender and reciever compomenet are very far then we can use observable seream using a data sharing service
@input() and @output() property decorators are used to pass data arround
> View Encapsulation
In angular a compoenent is associated with a SCSS file which is very specefic to that acompoenent .
but commmon CSS behaviour does not work like that It apply CSS to all element of that file.
@Abhinay-g
Abhinay-g / C# code
Created February 28, 2019 15:11
C# code
using System;
using System.Collections.Generic;
class MyClass {
static void Main(string[] args) {
string[] ip = Console.ReadLine().Trim().Split(' ');
long a = Convert.ToInt64(ip[0]);
long b = Convert.ToInt64(ip[1]);
Console.Write(commDiv(a,b));
@Abhinay-g
Abhinay-g / IELTS words
Last active February 18, 2019 16:00
IELTS words
Debris:Construction Debris
Caddies: Someone who lift golf bag, kind of helper
Wager: synonym for bet
Sprawls: Land spred arround
Debilitate : makeing someone weak [many hard drungs are debilitating society ]