MongoDB ?

 MongoDB is a cross-platform, document-oriented database that provides, high performance, high availability, and easy scalability. MongoDB works on the concept of collection and document.

Database

The database is a physical container for collections. Each database gets its own set of files on the file system. A single MongoDB server typically has multiple databases.

Collection

A collection is a group of MongoDB documents. It is the equivalent of an RDBMS table. A collection exists within a single database. Collections do not enforce a schema. Documents within a collection can have different fields. Typically, all documents in a collection are of similar or related purposes.

Document

A document is a set of key-value pairs. Documents have a dynamic schema. Dynamic schema means that documents in the same collection do not need to have the same set of fields or structure, and common fields in a collection's documents may hold different types of data.

The following table shows the relationship of RDBMS terminology with MongoDB.





RDBMSMongoDB
DatabaseDatabase
TableCollection
Tuple/RowDocument
columnField
Table JoinEmbedded Documents
Primary KeyPrimary Key (Default key _id provided by MongoDB itself)
Database Server and Client
mysqld/Oraclemongod
mysql/sqlplusmongo

Sample Document

The following example shows the document structure of a blog site, which is simply a comma-separated key-value pair.

{
   _id: ObjectId(7df78ad8902c)
   title: 'MongoDB Overview', 
   description: 'MongoDB is no sql database',
   by: 'tutorials point',
   url: 'http://www.tutorialspoint.com',
   tags: ['mongodb', 'database', 'NoSQL'],
   likes: 100, 
   comments: [	
      {
         user:'user1',
         message: 'My first comment',
         dateCreated: new Date(2011,1,20,2,15),
         like: 0 
      },
      {
         user:'user2',
         message: 'My second comments',
         dateCreated: new Date(2011,1,25,7,45),
         like: 5
      }
   ]
}

_id is a 12 bytes hexadecimal number which assures the uniqueness of every document. You can provide _id while inserting the document. If you don’t provide then MongoDB provides a unique id for every document. These 12 bytes first 4 bytes for the current timestamp, next 3 bytes for machine id, next 2 bytes for process id of MongoDB server, and remaining 3 bytes are simple incremental VALUE

Continue Reading...

Useful .NET CLI (dotnet) commands

 

Commonly used Commands

Here are some of the commonly used commands for the dotnet

Command

Description

new

Creates a new project, configuration file, or solution based on the specified template.

restore

Restores the dependencies and tools of a project.

build

Builds a project and all of its dependencies.

publish


Packs the application and its dependencies into a folder for deployment to a hosting system.

run

Runs source code without any explicit compile or launch commands.

test

.NET test driver used to execute unit tests.

vstest

Runs tests from the specified files.

pack

Packs the code into a NuGet package.

migrate

Migrates a Preview 2 .NET Core project to a .NET Core SDK 1.0 project.

clean

Cleans the output of a project.

sln

Modifies a .NET Core solution file.

help

Shows more detailed documentation online for the specified command.

store

Stores the specified assemblies in the runtime package store.


Creating a New ASP.NET Core project using dotnet CLI

Open the command prompt or Windows Powershell and create a Folder named “HelloWorld”

Dotnet new

dotnet new command is used to create the new project. The partial syntax is as follows

1

2

3

 

dotnet new <TEMPLATE> [--force] [-i|--install] [-lang|--language] [-n|--name] [-o|--output]

 

Where

TEMPLATE

The template to instantiate when the command is invoked

–force

Forces content to be generated even if it would change existing files. This is required when the output directory already contains a project.

-i|–install <PATH|NUGET_ID>

Installs a source or template pack from the PATH or NUGET_ID provided.

-l|–list

Lists templates containing the specified name. If invoked for the dotnet new command, it lists the possible templates available for the given directory. For example, if the directory already contains a project, it doesn’t list all project templates.

-lang|–language {C#|F#|VB}

The language of the template to create. The language accepted varies by the template (see defaults in the arguments section). Not valid for some templates.

-n|–name <OUTPUT_NAME>

The name for the created output. If no name is specified, the name of the current directory is used.

-o|–output <OUTPUT_DIRECTORY>

Location to place the generated output. The default is the current directory.

-h|–help

Prints out help for the command

The complete list of options for dotnet new is available here

Create a New Project using dotnet new

The following command creates a new dotnet project using the TEMPLATE

1

2

3

 

dotnet new <TEMPLATE>

 

You can find out the list of template using

1

2

3

 

Dotnet new -l

 

List of Templates

Template

Description

console

Console Application

classlib

Class library

mstest

Unit Test Project

xunit

xUnit Test Project

web

ASP.NET Core Empty

mvc

ASP.NET Core Web App (Model-View-Controller)

razor

ASP.NET Core Web App

angular

ASP.NET Core with Angular

react

ASP.NET Core with React.js

reactredux

ASP.NET Core with React.js and Redux

webapi

ASP.NET Core Web API

To create an empty web application use the template web

1

2

3

 

Dotnet new web

 

Restoring the Dependencies with dotnet restore

Once we created the new project, we have to download the dependencies. This is done using the restore command

1

2

3

 

Dotnet restore

 

use –help to get help

1

2

3

 

Dotnet restore --help

 



Continue Reading...

Rounding decimal values In Dynamics NAV

 As Navision is a financial system, it's obvious that most of the time we need to handle decimal values, and rounding decimals is a very important part of it. When we are converting high-value currency to low-value currency, a small decimal can make a big difference



Name

Type

AmountToRound

Decimal

RoundToNearest

Decimal

RoundToUp

Decimal

RoundToDown

Decimal



AmountToRound:=345.8689999999;

 RoundToNearest:=ROUND(AmountToRound,0.01,'=');

 RoundToUp:=ROUND(AmountToRound,0.01,'>');

 RoundToDown:=ROUND(AmountToRound,0.01,'<');

Continue Reading...

Duration Data Type in Dynamics NAV

 Represents the difference between two DateTimes. This value can be negative. It is stored as a     64-bit integer. The integer value is the number of milliseconds during the duration.

The following are examples of durations:

DATETIME-DATETIME=DURATION

DATETIME-DURATION=DATETIME

DATETIME+DURATION=DATETIME


This example is run on a computer with the Current Format in the Regional and Language

VariableDataType
DateTime1DateTime
Datetime2DateTime
DurationDuration

DateTime1 := CREATEDATETIME(010109D, 080000T); // January 1, 2009 at 08:00:00 AM DateTime2 := CREATEDATETIME(050509D, 133001T); // May 5, 2009 at 1:30:01 PM Duration := DateTime2 - DateTime1; MESSAGE(FORMAT(Duration));  


Continue Reading...

How Changing Default Language In Navision or Business Central

 

You can change the default language setting in Navision or Business Central instance. 

 Web service date format sync. with your system date format.



Language Format List Country Wise.

ISO 3166 Country CodeISO639-2 Country CodeCountryISO639-2 LangLanguageDate FormatISO639- Lang
ALBALAlbaniasqAlbanianyyyy-MM-ddsq-AL
AREAEUAEarArabicdd/MM/yyyyar-AE
ARGARArgentinaesSpanishdd/MM/yyyyes-AR
AUSAUAustraliaenEnglishd/MM/yyyyen-AU
AUTATAustriadeGermandd.MM.yyyyde-AT
BELBEBelgiumfrFrenchd/MM/yyyyfr-BE
BELBEBelgiumnlDutchd/MM/yyyynl-BE
BGRBGBulgariabgBulgarianyyyy-M-dbg-BG
BHRBHBahrainarArabicdd/MM/yyyyar-BH
BLRBYBelarusbeBelarusiand.M.yyyybe-BY
BOLBOBoliviaesSpanishdd-MM-yyyyes-BO
BRABRBrazilptPortuguesedd/MM/yyyypt-BR
CANCACanadafrFrenchyyyy-MM-ddfr-CA
CANCACanadaenEnglishdd/MM/yyyyen-CA
CHECHSwitzerlanddeGermandd.MM.yyyyde-CH
CHECHSwitzerlandfrFrenchdd.MM.yyyyfr-CH
CHECHSwitzerlanditItaliandd.MM.yyyyit-CH
CHLCLChileesSpanishdd-MM-yyyyes-CL
CHNCNChinazhChineseyyyy-M-dzh-CN
COLCOColombiaesSpanishd/MM/yyyyes-CO
CRICRCosta RicaesSpanishdd/MM/yyyyes-CR
CYPCYCypruselGreekdd/MM/yyyyel-CY
CZECZCzech RepubliccsCzechd.M.yyyycs-CZ
DEUDEGermanydeGermandd.MM.yyyyde-DE
DNKDKDenmarkdaDanishdd-MM-yyyyda-DK
DZADZAlgeriaarArabicdd/MM/yyyyar-DZ
ECUECEcuadoresSpanishdd/MM/yyyyes-EC
EGYEGEgyptarArabicdd/MM/yyyyar-EG
ESPESSpainesSpanishd/MM/yyyyes-ES
ESPESSpaincaCatalandd/MM/yyyyca-ES
ESTEEEstoniaetEstoniand.MM.yyyyet-EE
FINFIFinlandfiFinnishd.M.yyyyfi-FI
FRAFRFrancefrFrenchdd/MM/yyyyfr-FR
GBRGBUnited KingdomenEnglishdd/MM/yyyyen-GB
GRCGRGreeceelGreekd/M/yyyyel-GR
GTMGTGuatemalaesSpanishd/MM/yyyyes-GT
HKGHKHong KongzhChineseyyyy年M月d日zh-HK
HNDHNHondurasesSpanishMM-dd-yyyyes-HN
HRVHRCroatiahrCroatiandd.MM.yyyy.hr-HR
HUNHUHungaryhuHungarianyyyy.MM.dd.hu-HU
IDNIDIndonesiainIndonesiandd/MM/yyyyin-ID
INDINIndiahiHindi३/६/१२hi-IN
INDINIndiaenEnglishd/M/yyyyen-IN
IRLIEIrelandgaIrishdd/MM/yyyyga-IE
IRLIEIrelandenEnglishdd/MM/yyyyen-IE
IRQIQIraqarArabicdd/MM/yyyyar-IQ
ISLISIcelandisIcelandicd.M.yyyyis-IS
ISRILIsraeliwHebrewdd/MM/yyyyiw-IL
ITAITItalyitItaliandd/MM/yyyyit-IT
JORJOJordanarArabicdd/MM/yyyyar-JO
JPNJPJapanjaJapaneseyyyy/MM/ddja-JP
JPNJPJapanjaJapaneseH24.MM.ddja-JP
KORKRSouth KoreakoKoreanyyyy. M. dko-KR
KWTKWKuwaitarArabicdd/MM/yyyyar-KW
LBNLBLebanonarArabicdd/MM/yyyyar-LB
LBYLYLibyaarArabicdd/MM/yyyyar-LY
LTULTLithuanialtLithuanianyyyy.M.dlt-LT
LUXLULuxembourgfrFrenchdd/MM/yyyyfr-LU
LUXLULuxembourgdeGermandd.MM.yyyyde-LU
LVALVLatvialvLatvianyyyy.d.Mlv-LV
MARMAMoroccoarArabicdd/MM/yyyyar-MA
MEXMXMexicoesSpanishd/MM/yyyyes-MX
MKDMKMacedoniamkMacedoniand.M.yyyymk-MK
MLTMTMaltaenEnglishdd/MM/yyyyen-MT
MLTMTMaltamtMaltesedd/MM/yyyymt-MT
MNEMEMontenegrosrSerbiand.M.yyyy.sr-ME
MYSMYMalaysiamsMalaydd/MM/yyyyms-MY
NICNINicaraguaesSpanishMM-dd-yyyyes-NI
NLDNLNetherlandsnlDutchd-M-yyyynl-NL
NORNONorwaynoNorwegiandd.MM.yyyyno-NO
NORNONorwaynoNorwegiandd.MM.yyyyno-NO
NZLNZNew ZealandenEnglishd/MM/yyyyen-NZ
OMNOMOmanarArabicdd/MM/yyyyar-OM
PANPAPanamaesSpanishMM/dd/yyyyes-PA
PERPEPeruesSpanishdd/MM/yyyyes-PE
PHLPHPhilippinesenEnglishM/d/yyyyen-PH
POLPLPolandplPolishdd.MM.yyyypl-PL
PRIPRPuerto RicoesSpanishMM-dd-yyyyes-PR
PRTPTPortugalptPortuguesedd-MM-yyyypt-PT
PRYPYParaguayesSpanishdd/MM/yyyyes-PY
QATQAQatararArabicdd/MM/yyyyar-QA
ROURORomaniaroRomaniandd.MM.yyyyro-RO
RUSRURussiaruRussiandd.MM.yyyyru-RU
SAUSASaudi ArabiaarArabicdd/MM/yyyyar-SA
SCGCSSerbia and MontsrSerbiand.M.yyyy.sr-CS
SDNSDSudanarArabicdd/MM/yyyyar-SD
SGPSGSingaporezhChinesedd/MM/yyyyzh-SG
SGPSGSingaporeenEnglishM/d/yyyyen-SG
SLVSVEl SalvadoresSpanishMM-dd-yyyyes-SV
SRBRSSerbiasrSerbiand.M.yyyy.sr-RS
SVKSKSlovakiaskSlovakd.M.yyyysk-SK
SVNSISloveniaslSloveniand.M.yyyysl-SI
SWESESwedensvSwedishyyyy-MM-ddsv-SE
SYRSYSyriaarArabicdd/MM/yyyyar-SY
THATHThailandthThaid/M/2555th-TH
THATHThailandthThai๓/๖/๒๕๕๕th-TH
TUNTNTunisiaarArabicdd/MM/yyyyar-TN
TURTRTurkeytrTurkishdd.MM.yyyytr-TR
TWNTWTaiwanzhChineseyyyy/M/dzh-TW
UKRUAUkraineukUkrainiandd.MM.yyyyuk-UA
URYUYUruguayesSpanishdd/MM/yyyyes-UY
USAUSUnited StatesenEnglishM/d/yyyyen-US
USAUSUnited StatesesSpanishM/d/yyyyes-US
VENVEVenezuelaesSpanishdd/MM/yyyyes-VE
VNMVNVietnamviVietnamesedd/MM/yyyyvi-VN
YEMYEYemenarArabicdd/MM/yyyyar-YE
ZAFZASouth AfricaenEnglishyyyy/MM/dden-ZA

Continue Reading...