Skip to content

nealzxc/lua-bson

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Introduction

This is a simple BSON library for Lua.

Building

make win

or

make linux

Types

Lua TypeBSON TypeNotes
bson.nullNull
booleanBoolean
numberDouble
number32-bit integer
number64-bit integerprecision lost
stringString
tableBSON Document
tableBSON ArrayLua table must be a sequence. (Continuous number key base 1)
bson.date(os.time())UTC Datetimemilliseconds since epoch
bson.timestamp(os.time())Timestampspecial mongodb type, two 32-bit number
bson.regex(regex,option)Regular Expression
bson.objectid()ObjectIDMongoDB document ID
bson.minkeyMin Key
bson.maxkeyMax Key

Replace field

These bson types (fixed length) below can be replace by new value after encode to bson object.

  • int32
  • int64
  • double
  • boolean
  • date
  • timestamp
  • objectid

You need call makeindex() before replace.

Getting started

See test.lua

About

A BSON library for lua

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published