Use Reference Documents for Lookups - Couchbase - nosql

Does anyone have an example related to reference documents for couchbase?
I have found this example: http://www.couchbase.com/docs/couchbase-devguide-2.0/reference-docs-and-lookup-pattern.html
But I need an example for the Java SDK.
Thanks

Nothing special here, as M03geek stated in his comment you have to do the same using the Java SDK.
I have created a gist for you:
https://gist.github.com/tgrall/6105234

Related

Grails using gridfs of mongo - plugins not matching

My application needs to use mongodb for normal data storage and also to keep pretty large files. Hence I started with plugins for mongodb (for normal data storage) and gridfs (for large files).
I am using grails 2.3.4 and trying to figure out what is the issue with the plugins that are included for using both mongodb and gridfs.
I have been searching the entire internet (including stalkoverflow) to find out any plugins that co-exists but in vain. Because no matter I use what combination of the available plugins, it all shows errors saying compatibility issues.
I am using the driver mongo-java-driver-2.11.3.jar
I ended up trying all plugins currently available. My build-config file looks like this:
<<<
// compile ":mongodb:1.3.3"
// compile ":mongodb:1.0.0.GA"
// compile ":gorm-mongodb:0.5.4"
// compile ":zk-mongodb:1.1-M1"
compile ":mongodb-morphia:0.8.2"
compile ":mongo-file:1.1.1"
// compile ":mongodb-gridfs:0.5.beta"
>
I know that I am missing something here.
Has anybody used grails2.3.4 and mongodb with gridfs ?
Please help me out either by pointing the correct plugins or sending code snippets of working samples.
Thank you all in advance.
I had a similar problem when I used ":mongodb-gridfs:0.5.beta" as well. In fact, even when I tried to remove the plugin (via my IDE) it continued to error. I deleted plugins.mongodb-gridfs=0.5.beta from application.properties, and then my application could build again.
You shouldn't need a separate plugin to use GridFS, it's actually part of the MongoDB Java driver. You will, however, need to get to the lower-level API instead of using the default Grails GORM stuff - there's some info on how to do this here.
The GridFS API works in a slightly different way to the rest of the driver, but here's an example. To create the GridFS to work with, you'll need something like new GridFS(mongo.getDB(databaseName)).
I don't have a fully working example to show you, but I hope you can piece together what you need from those different examples.
I've been using webfs which has worked very well for us in the past. It's a lightweight grails plugin for managing files using Mongo's gridfs. See https://github.com/dlaidlaw/mongo-web-filesystem for more details.
I use the webfs plugin in our document management module for managing any type of documents, up to 250MB in size. Am using mongodb:1.2.0.
I've not tested it with Grails 2.3.4, but it works on 2.0, 2.1 and 2.2.

Programs and downloads for a serverside mongo-dart DB

I have been programming with dart for a while now and after I tried LocalStorage, I wanted to start with a server-side mongo-dart app. So my question is:
What do I need as far as programs and downloads beside the Darteditor and Chromium?
I would be very happy about an answer.
Thanks in advance!
Karl
There is no official MongoDB driver for Dart language mentiond on MongoDB site http://docs.mongodb.org/ecosystem/drivers/.
However you can find a driver on GitHub by vadimtsushko:
https://github.com/vadimtsushko/mongo_dart
He also wrote tutorial http://blog.dartwatch.com/2012/03/building-client-server-dart-app-part-2.html
Hope it gives you something to start with.
Here is a blog post I wrote awhile back that does a full stack example using mongodb and dart
http://financecoding.github.com/blog/2013/01/16/darting-a-full-stack/
The server side is still light, I'd suggest experimenting stream from rikulo http://rikulo.org/projects/stream Might be a cleaner solution then rolling your own web server.
Have fun!

How to add one project to another(Xcode)

I wright english very bad,but I hope you'l try to help me)
There is a problem: have one project that contains another 2 projects(that contains classes I using in main project),when try to compile-there are many fails,because main project couldn't find classes from that projects. I tried to add them from build phases->link binary with files-but it doesn't help me(
Help me please with this problem!Thank you!
In Xcode 4, this is done through Workspaces. This is a fairly big topic, so I will just link you to Apple's high-level document and a blog post that walks through the process of setting one up.
Apple doc: http://developer.apple.com/library/ios/#featuredarticles/XcodeConcepts/Concept-Workspace.html
Walkthrough: http://cocoamanifest.net/articles/2011/06/library-management-with-xcode-workspaces.html
Good luck!
Try adding them as Target Dependencies instead.

node-mongodb-native example code vs docs code? which to use?

I just wrote my first nodejs program using the node-mongodb-native driver. I used the documentation code from the github page, i.e.:
var mongodb = require("mongodb"),
mongoserver = new mongodb.Server('localhost', 6574),
dbConnector = new mongodb.Db('test', mongoserver);
dbConnector.open(function(err, db){
if(err)
console.log('oh shit! connector.open error!');
else{
...
However, upon looking at some example code on the github page, I discovered that the set up code looks very different from what I used. Does anybody know if there's any real difference between the different methods? I'm completely new to all this stuff and can't really tell if there's any reason to use one over the other. The code I wrote seems to run fine, but if the creator of the driver is using different code, I figured it would be worth checking if there are any reasons for that.
Thanks in advance for any replies!
Sami
Hi I'm the creator and no there is no particular reason you can't use your style. As when it comes to docs I usually tell people to start with the integration tests as there are many examples on how to do stuff. Unfortunately due to having a fulltime job the docs are not kept up to date at the pace I would like to.
I'm hoping to do something with that come late september but right now I'm trying to just get the driver up to the expected features of mongodb including making it work with 1.9.X and higher.
I'll accept any docs pull requests happily as the more the community help me the more it helps itself :)

iOS - TBXML - Get ALL <img>-tags

I tried to start with TBXML, but I don't understand how it works...
How can I get ALL img-tags (as TBXMLElement) from a document?
Did you read the guide? Start from here and then proceed here. You mentioned that you are trying to retrieve only a certain tag type from your document but did not post your overall structure or any example code. If you want more detailed help then you will have to post a more detailed question.