Skip to content

Instantly share code, notes, and snippets.

name := "mongo-test"
version := "1.0"
scalaVersion := "2.9.2"
libraryDependencies += "org.mongodb" %% "casbah" % "2.5.0"
@jsr
jsr / insert_po.sql
Created July 6, 2011 20:38
Gists for transactions post
START TRANSACTION;
/* Create a purchase order row */
INSERT INTO purchase_orders (id,title,total) VALUES (1, ‘purchase order 1’, 10.50);
/* Create a line item, including the foreign key of the purchase order we just created */
INSERT INTO line_items(id,sku,quantity,price,purchase_order_id) VALUES (2, ‘a’, 1, 10.50 1);
COMMIT;
source "http://rubygems.org"
gem "rails", "3.0.5"
gem "mongo_mapper"
gem "bson_ext"
var Db = require('/usr/local/lib/node/mongodb').Db,
Server = require('/usr/local/lib/node/mongodb').Server;
var client = new Db('nodejs_test', new Server("127.0.0.1", 27017, {}));
client.open(function(err,p_client) {
client.createCollection('test_insert', function( err, collection ){
client.collection('test_insert', function(err,collection) {
collection.save({_id:ObjectId('4d4c45209a54301520000001'),d:3}, function(err,docs) {console.log(err)});
})
<html>
<head>
<script type="text/javascript">
//<![CDATA[
var _gaq = _gaq || [];
(function() {
var headTime = new Date().getTime();
var reportTimeSegment = function(index, name, start, end, scope) {
if( (start && end) && (end-start > 0) ) {
var distance = Math.round( (end-start)/100 )*100;