How to Return an two non-consecutive Index Values from an Array

Hope to get help, I must find two data with array. mongodb version 2.6.6

test statement:

db.test.insert({"student":[1,2,3,4,5]})

Know two index 1 and 3, can you use a statement query, find array student[1] and student[3] value.
I only know that query a value, which is the following statement

db.test.find({},{'student': {'$slice':[2,2]}})

my question was how to find student array two value by a statement query.
I want to output the value 2, 4.

How to Return an two non-consecutive Index Values from an Array

read more

How to Return an two non-consecutive Index Values from an Array

Hope to get help, I must find two data with array. mongodb version 2.6.6

test statement:

db.test.insert({"student":[1,2,3,4,5]})

Know two index 1 and 3, can you use a statement query, find array student[1] and student[3] value.
I only know that query a value, which is the following statement

db.test.find({},{'student': {'$slice':[2,2]}})

my question was how to find student array two value by a statement query.
I want to output the value 2, 4.

How to Return an two non-consecutive Index Values from an Array

read more

mongodb how to find array two index value in shell

Hope to get help, I must find two data with array. mongodb version 2.6.6

test statement:

db.test.insert({"student":[1,2,3,4,5]})

Know two index 1 and 3, can you use a statement query, find array student[1] and student[3] value.
I only know that query a value, which is the following statement

db.test.find({},{'student': {'$slice':[2,2]}})

my question was how to find student array two value by a statement query.
I want to output the value 2, 4.

mongodb how to find array two index value in shell

Apache does not have write permission on html folder

I installed apache, MySQL, PHP in CentOS 7. All work well, except apache cannot write file in html folder. I found this problem when I used file_put_contents. I tried

  1. Change owner of /var/www to apache:apache, not work
  2. Added Order allow,deny Allow from all to <Directory "/var/www/html"> in httpd.conf, restart httpd service, not work
  3. chmod -R 0777 /var/www/html, not work

What is wrong with my server? Please help me!

UPDATE1: result of ls -al /var/www/html

total 40
drwxrwxrwx. 5 apache apache 4096 Sep 23 10:19 .
drwxr-x---. 4 apache apache 31 Sep 18 01:50 ..
drwxrwxrwx. 15 apache apache 4096 Sep 23 08:43 folder1
drwxrwxrwx+ 10 apache apache 4096 Sep 23 10:19 folder2
-rwxrwxrwx. 1 apache apache 1574 Sep 5 08:55 favicon.ico
-rwxrwxrwx. 1 apache apache 603 Sep 22 05:05 .htaccess
-rwxrwxrwx. 1 apache apache 9841 Sep 8 08:34 index.php
drwxrwxrwx. 8 apache apache 4096 Sep 23 08:44 folder3

read more

Apache does not have write permission on html folder

I installed apache, MySQL, PHP in CentOS 7. All work well, except apache cannot write file in html folder. I found this problem when I used file_put_contents. I tried

  1. Change owner of /var/www to apache:apache, not work
  2. Added Order allow,deny Allow from all to <Directory "/var/www/html"> in httpd.conf, restart httpd service, not work
  3. chmod -R 0777 /var/www/html, not work

What is wrong with my server? Please help me!

UPDATE1: result of ls -al /var/www/html

total 40
drwxrwxrwx. 5 apache apache 4096 Sep 23 10:19 .
drwxr-x---. 4 apache apache 31 Sep 18 01:50 ..
drwxrwxrwx. 15 apache apache 4096 Sep 23 08:43 folder1
drwxrwxrwx+ 10 apache apache 4096 Sep 23 10:19 folder2
-rwxrwxrwx. 1 apache apache 1574 Sep 5 08:55 favicon.ico
-rwxrwxrwx. 1 apache apache 603 Sep 22 05:05 .htaccess
-rwxrwxrwx. 1 apache apache 9841 Sep 8 08:34 index.php
drwxrwxrwx. 8 apache apache 4096 Sep 23 08:44 folder3

read more