func (j *JSONQ) From(node string) *JSONQ {
	j.node = node
	v, err := getNestedValue(j.jsonContent, node, j.option.separator)
	if err != nil {
		j.addError(err)
	}
	j.jsonContent = v
	return j
}
From seeks the json content to provided node. e.g: "users.[0]"  or "users.[0].name"
package gojsonq
import (
	"bytes"
	"encoding/json"
	"fmt"
	"io"
	"io/ioutil"
)
func New(options ...OptionFunc) *JSONQ {
	jq := &JSONQ{
		queryMap: defaultQueries(),
		option: option{
			decoder:   &DefaultDecoder{},
			separator: defaultSeparator,
		},
	}
	for _, option := range options {
		if err := option(jq); err != nil {
			jq.addError(err)
		}
	}
	return jq
}
var empty interface{}
const defaultSeparator = "."
type query struct {
	key, operator string
	value         interface{}
}
type JSONQ struct {
	option           option                
	queryMap         map[string]QueryFunc  
	node             string                
	raw              json.RawMessage       
	rootJSONContent  interface{}           
	jsonContent      interface{}           
	queryIndex       int                   
	queries          [][]query             
	attributes       []string              
	offsetRecords    int                   
	limitRecords     int                   
	distinctProperty string                
	errors           []error               
}
func (j *JSONQ) String() string {
	return fmt.Sprintf("\nContent: %s\nQueries:%v\n", string(j.raw), j.queries)
}
func (j *JSONQ) decode() *JSONQ {
	err := j.option.decoder.Decode(j.raw, &j.rootJSONContent)
	if err != nil {
		return j.addError(err)
	}
	j.jsonContent = j.rootJSONContent
	return j
}
func (j *JSONQ) Copy() *JSONQ {
	tmp := *j
	return tmp.reset()
}
func (j *JSONQ) File(filename string) *JSONQ {
	bb, err := ioutil.ReadFile(filename)
	if err != nil {
		return j.addError(err)
	}
	j.raw = bb
	return j.decode()  
}
func (j *JSONQ) JSONString(json string) *JSONQ {
	return j.FromString(json)
}
func (j *JSONQ) FromString(str string) *JSONQ {
	j.raw = []byte(str)
	return j.decode()  
}
func (j *JSONQ) Reader(r io.Reader) *JSONQ {
	buf := new(bytes.Buffer)
	_, err := buf.ReadFrom(r)
	if err != nil {
		return j.addError(err)
	}
	j.raw = buf.Bytes()
	buf.Reset()  
	return j.decode()
}
func (j *JSONQ) Error() error {
	errsln := len(j.errors)
	if errsln == 0 {
		return nil
	}
	return j.errors[0]
}
func (j *JSONQ) Errors() []error {
	return j.errors
}
func (j *JSONQ) addError(err error) *JSONQ {
	j.errors = append(j.errors, fmt.Errorf("gojsonq: %v", err))
	return j
}
func (j *JSONQ) Macro(operator string, fn QueryFunc) *JSONQ {
	if _, ok := j.queryMap[operator]; ok {
		j.addError(fmt.Errorf("%s is already registered in query map", operator))
		return j
	}
	j.queryMap[operator] = fn
	return j
}