Skip to content

Instantly share code, notes, and snippets.

View ahmetonurslmz's full-sized avatar
🎯
Focusing

Ahmet Onur Solmaz ahmetonurslmz

🎯
Focusing
View GitHub Profile
@ahmetonurslmz
ahmetonurslmz / updating-nested-array-inside-array-mongodb.md
Last active August 15, 2023 03:11
Updating nested array inside array mongodb

Updating nested array inside array mongodb

For example: We have a document like this one;

clubs:{
cid: 1,
cname: "Fenerbahce",
cplayers: [{

pid: 1,

@ahmetonurslmz
ahmetonurslmz / find-nested-array-of-objects-inside-an-array-of-objects.md
Created February 16, 2020 06:29
Find nested array of objects inside an array of objects

Find nested array of objects inside an array of objects

To illustrate, We have a nested array object in object

const Clubs= new Schema({
  {cid: 1,
  c_name: "Fenerbahce",
  c_players: [
    {
    pid: 1,

p_name: "Elif Elmas"

@ahmetonurslmz
ahmetonurslmz / pleks-syntax-error-problem.md
Created February 16, 2020 06:32
Pleks Panel - Syntax Error Problem

Pleks Panel - Syntax Error Problem

Error that we handled:
  syntax error, unexpected end of file in /var/www/vhosts/username/httpdocs/index.php on line 248

This error occurs because of short_open_tag option in PHP settings. If you are sure your code is clear and does not include syntax error, you should open short_open_tag option. This feature is closed by default.

@ahmetonurslmz
ahmetonurslmz / sql_on_delete.md
Created August 22, 2020 12:56
SQL - Attitudes types to adopted record when referenced record is deleted
  1. CASCADE: This enables us to remove its all adopted records when parent is deleted. For example, we have removed blog record, its adopted comment records will be deleted.

  2. RESTRICT: This enables us to prevent deletion of record when it has a adopted record at least.

  3. These enable us to set data that we want into relation column of adopted records that we will remove its parent.

  • SET NULL:
  • SET DEFAULT:
  • SET (...):
  1. NO ACTION: It does not anything. You should avoid choose this inside all of these choices.