Sponsored Content
Top Forums Programming Question regarding a book for C++ Post 303020739 by Corona688 on Thursday 26th of July 2018 11:47:02 AM
Old 07-26-2018
C is the underpinnings for C++. If you do not understand C, your understanding of C++ will be poor. Most people skip it... and most programmers are poor.
This User Gave Thanks to Corona688 For This Post:
 

7 More Discussions You Might Find Interesting

1. Programming

Good book

I just want to know if someone can tell me if this book "C Programming Language (2nd Edition) by Brian W. Kernighan, Dennis M. Ritchie" is a good book to learn C on unix/linux ??? i'm an old (33 :)) mainframe programmer who wants to learn something else besides cobol and pl/1 ...... (2 Replies)
Discussion started by: pat
2 Replies

2. HP-UX

HP-UX Internals Book

. (2 Replies)
Discussion started by: Driver
2 Replies

3. Solaris

e-book

Hi everybody I a new one And I have just wanted to research on Sun Solaris So can you help me what e-book to read ( and if can you give me the direct address to load ) Thks so much (3 Replies)
Discussion started by: iwbasts
3 Replies

4. Shell Programming and Scripting

Book and Links about Shells; and zsh question

HI, I would like to ask You about some good books or links where I can find information about shells, theoretical information. I will be grateful if You can help me And I have question about zsh loop trivial script: #!/bin/zsh for i in {1..100000} do echo $i; doneexec time is 10... (9 Replies)
Discussion started by: Physix
9 Replies

5. What is on Your Mind?

looking for a book suggestion

On the basic concepts of programming. I mean I am 100% self taught so I need a book to fix all my bad habits and misconceptions. I mean I want a solid book over the basics. Explains what an array is, a string, variable, stacks, and so forth. I only know how to write code in shell,... (7 Replies)
Discussion started by: tlarkin
7 Replies

6. UNIX for Dummies Questions & Answers

Is this a typo in my Book?

I'm currently learning Bash scripting from a book and the following example is given, but I think there is a typo in the variable assignment for the variable file. $ cat test5 #!/bin/bash # reading values from a file file=“states” ( shouldn't this be file=`cat states` assuming you... (23 Replies)
Discussion started by: Riker1204
23 Replies

7. AIX

A book for sysadmin

Please i searching a book which covering system administration of aix7 or 6 :lvm,virtualization,fs,etc Ebook and amazon ok. Do you know something good? Thanks (1 Reply)
Discussion started by: Linusolaradm1
1 Replies
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)
All times are GMT -4. The time now is 05:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy