-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconvert.php
More file actions
41 lines (33 loc) · 1.09 KB
/
convert.php
File metadata and controls
41 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!doctype html>
<!--
Author:
Email: skip@stritter.com
Filename: convert.php
Date: 6/2015
Description: one-time conversion to change 'ch_id' in 'activities' collection from scalar to array
-->
<?php $page_title = 'Looma xxxx ';
include ('includes/header.php');
include ('includes/mongo-connect.php')
?>
</head>
<body>
<?php
$cursor = $activities_collection -> find();
//NOTE: one-time conversion to change 'ch_id' in 'activities' collection from scalar to array
// do not run again
//
// code commented out so it wont be run inadvertently
/*
foreach ($cursor as $item) {
echo "Item: " . (isset($item['dn']) ? $item['dn'] : "<none>") . " (" . $item['_id']. ")<br>";
$chapter = $item['ch_id'];
$id = $item['_id'];
$activities_collection -> update(array('_id' => $id), array('$unset' =>array('ch_id' => 1)));
$activities_collection -> update(array('_id' => $id), array('$addToSet' => array('ch_id' => $chapter)));
}
*/
?>
<?php include ('includes/js-includes.php'); ?>
</body>
</html>