Friday 6 September 2019

Install FFMPEG in Azure Serverless Architecture

Install FFMPEG in Azure Serverless Architecture

Create "Function" in "Function App" in Azure (If you have not created)

https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-azure-function


Install FFMPEG in Azure Server

  1. Now Go to Function App, and Click on the your "Function App"
  2. Click on "Platform Features" then click on "Advance tools (Kudu)" like blow
  3. In Kudu, select CMD from the Debug console menu.
  4. Now, you can navigate to the folder by click on site -> wwwroot.

  5. Create a folder with bin,here we will put the ffmpeg library.
  6. a. Go to the https://ffmpeg.zeranoe.com/builds/ (for FFMPEG)
    b. Download the build as per Architecture.
    c. Unzip the downloaded content.
    d. Now copy the ffmpeg.exe, ffplay.exe and ffprobe.exe (from bin folder in downloaded).
    e. Copy these three files in site -> wwwroot-> bin folder.
  7. Create a folder with wav_to_mp3,here we will store the media like photo, videos etc.
  8. Here you can run the ffmpeg command such ffmpeg -version



Saturday 31 August 2019

MongoDB operators with examples

MongoDB operators with examples

Comparison Query Selectors

$eq  Equal to a specified value.
$gt  Greater than a specified value.
$gte  Greater than or equal to a specified value.
$lt  Less than a specified value.
$lte  Less than or equal to a specified value.
$ne  Not equal to a specified value.
$in  Matches any of the values specified in an array.
$nin  Matches none of the values specified in an array.

Example:
db.mycollectiontest.find('{"likes": {$gt:10}"likes"}'); 


Logical Query Selectors
$or  Joins query clauses with a logical OR Operator.
$and  Joins query clauses with a logical AND Operator.
$not  Inverts the effect of a query expression.
$nor  Joins query clauses with a logical NOR returns.

Example
db.mycollectiontest.find({"likes": {$gt:10}, $or: [{"by": "tutorials point"})


Element Query Selectors
$exists  Matches documents that have the specified field.
$type  Selects documents if a field is of the specified type.



Evalution Query Selector
$mod  Performs a modulo operation.
$regex  Specified regular expression.
$text  Performs text search.
$where  Matches documents that satisfy a JavaScript expression.



Array Query Selector
$all        Matches arrays that contain all elements specified in the query.
$elemMatch Selects documents if element in the array field matches all the specified $elemMatch conditions.
$size       Selects documents if the array field is a specified size.


Field Update Operators
$inc        Increments the value.
$mul        Multiplies the value.
$rename     Renames a field.
$setOnInsert Sets the value of a field if an update results in an insert of a document.
$set  Sets the value of a field in a document.
$unset  Removes the specified field from a document.
$min  Only updates the field if the specified value is less than the existing field value.
$max  Only updates the field if the specified value is greater than the existing field value.
$currentDate  Sets the value of a field to current date, either as a Date or a Timestamp.