06-24-2004
Past Time
Dear UNIX Folks,
I guess everyone of us like to know what sysadmin typically do during his free time.
Not what he/she likes as an hobbies.. but what activities does he/she often indulge in other than facing the monitor.
Maybe we can come up this a better stereo-typed for sysadmin.
I read VERITAS, SUN Blueprints, ORACLE Whitepaper when I am bored. Apart from that, I surf/read magazine to find nice food and romantic place for a date with my gf.
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Anyone know how to automate the Unzip password prompt?
I need to unzip a window's file in Unix without manually
typing in the password. (2 Replies)
Discussion started by: Ronny Lam
2 Replies
2. Solaris
Hi,
We've gotta bit of a problem regarding backups. Sometimes when we run a backup from a script :
find . -print |grep -v "^\.\/newicc" | grep -v "^\.\/proc" >$LST
cat $LST | cpio -oBcav > /dev/rmt/1cb
It quite often it seems to hang when it reaches the /etc/magic file. This happens... (2 Replies)
Discussion started by: PaulC
2 Replies
3. Shell Programming and Scripting
Hi,
I need to get the date and time for past 1 hour from the current date. Anyone know how to do so?
Thanks (5 Replies)
Discussion started by: spch2o
5 Replies
4. Shell Programming and Scripting
i am asking to do somethings like:
make use of 2 environment variables:
ASS1_DATA_DIR specifies the location of the input data files
ASS1_OUTPUT_DIR specifies the location of the output data files
i have something like that;
#set environment variables
set
VARIABLE1=ASS1_DATA_DIR... (5 Replies)
Discussion started by: mingming88
5 Replies
5. Solaris
Hello
I have a question that may sound stupid after and maybe it is.
We are syncing our sytem time via ntp from a reference time server. all works quite well
but due to a mall applikation which not accepts timestamps from our servers that in the future,
and if it even was 1 ms, we have to... (1 Reply)
Discussion started by: demwz
1 Replies
6. Shell Programming and Scripting
Hi guys,
could you help to find a way to get the past 30 mins time in solaris.
version:
bash-3.00# uname -a
SunOS solaris 5.10 Generic_142910-17 i86pc i386 i86pc
I had tried the following ways, it works fine in GNU Linux, but doesn't work in Solaris.
# date
Tue Apr 2 01:01:49 CST... (4 Replies)
Discussion started by: ambious
4 Replies
7. UNIX and Linux Applications
One of my job is taking long running time.
I need to identify from the unix log file can you please help how to troubleshoot. (1 Reply)
Discussion started by: Nsharma3006
1 Replies
8. Forum Support Area for Unregistered Users & Account Problems
Trying to register the Verification step is blocking me. I've allowed all the intrusive Google trackers and Java. Tried different browsers with no blocking. Nothing is working. Says: "Try again later Your computer maybe ... " What weird is in this forum section I can pass the recaptcha but in... (1 Reply)
Discussion started by: Unregistered
1 Replies
LEARN ABOUT PHP
mongodbref
MONGODBREF(3) 1 MONGODBREF(3)
The MongoDBRef class
INTRODUCTION
This class can be used to create lightweight links between objects in different collections.
Motivation: Suppose we need to refer to a document in another collection. The easiest way is to create a field in the current document. For
example, if we had a "people" collection and an "addresses" collection, we might want to create a link between each person document and an
address document:
Example #1
Linking documents
<?php
$people = $db->people;
$addresses = $db->addresses;
$myAddress = array("line 1" => "123 Main Street",
"line 2" => null,
"city" => "Springfield",
"state" => "Vermont",
"country" => "USA");
// save the address
$addresses->insert($myAddress);
// save a person with a reference to the address
$me = array("name" => "Fred", "address" => $myAddress['_id']);
$people->insert($me);
?>
Then, later on, we can find the person's address by querying the "addresses" collection with the MongoId we saved in the "people" collec-
tion.
Suppose now that we have a more general case, where we don't know which collection (or even which database) contains the referenced docu-
ment. MongoDBRef is a good choice for this case, as it is a common format that all of the drivers and the database understand.
If each person had a list of things they liked which could come from multiple collections, such as "hobbies", "sports", "books", etc., we
could use MongoDBRefs to keep track of what "like" went with what collection:
Example #2
Creating MongoDBRef links
<?php
$people = $db->selectCollection("people");
// model trains are in the "hobbies" collection
$trainRef = MongoDBRef::create("hobbies", $modelTrains['_id']);
// soccer is in the "sports" collection
$soccerRef = MongoDBRef::create("sports", $soccer['_id']);
// now we'll know what collections the items in the "likes" array came from when
// we retrieve this document
$people->insert(array("name" => "Fred", "likes" => array($trainRef, $soccerRef)));
?>
Database references can be thought of as hyperlinks: they give the unique address of another document, but they do not load it or automat-
ically follow the link/reference.
A database reference is just a normal associative array, not an instance of MongoDBRef, so this class is a little different than the other
data type classes. This class contains exclusively static methods for manipulating database references.
CLASS SYNOPSIS
MongoDBRef
MongoDBRef
Methods
o publicstatic array MongoDBRef::create (string $collection, mixed $id, [string $database])
o publicstatic array MongoDBRef::get (MongoDB $db, array $ref)
o publicstatic bool MongoDBRef::isRef (mixed $ref)
SEE ALSO
MongoDB core docs on databases references.
PHP Documentation Group MONGODBREF(3)