ObjCMongoDB db.collection.find() - objective-c

I want to implement complex queries on mongoDB in my iOS app. I’m using ObjCMongoDB and it’s working perfectly. I’m able to implement the count query on the database, please see the following code
commandDict = #{#"count": #"logs",#"query":#{#"detector":#"kaspersky"}};
commandDictdata = [dbConn runCommandWithDictionary:commandDict onDatabaseName:#"logdb" error:&error];
I’m trying to implement db.collection.find() but having troubles. Can anyone explain me how to do this.
Thanks.

-runCommandWithDictionary can't be used to perform the equivalent of db.collection.find().
You have to use MongoKeyedPredicate. At present the library doesn't have a way to pass a dictionary to mongo_find.
I'm the author of the library. A pull request would be welcome.

Related

YII2, rest API without database connection

I have been studying how to develop a rest API with YII and everything is clear from the documentation.
In the documentation they suggest using ActiveRecord however I will have inside my application some controllers that do nothing in the database, I mean they work with vectors or files or for example complex controllers that have to update several tables in the database or make queries to other APIs to later make updates.
What do you think is the best approach to fix this?
I would like to keep the same "Bearer Token" authentication for all controllers regardless of whether it is a simple one that works with ActiveRecord or a complex one that involves other actions.
Thank you in advanced.
Public function actionExample(){
// do stuff
// $result
return json_encode($result);
}

How to Trigger API with Rivescript?

First of all i'm new to this Rivescript which is used for making chat bots. can any one help me how to trigger Rest API which is already implemented in NodeJS. i heard that some <call> tag will help for this but i'm not getting how to do that. Any example will be appreciated. Thanks in advance.
We wanted to keep control on our side. So we ended up putting meta info in the rivescript file and wrote a custom parser which will make API call.
+ hi
- hi. | API:greeting
Parser splits the response by | and then all values on right side are for API. This can be extended to have any number of parameter to support all kinds of API calls.
This is NOT Rivescript way, but good thing is that it's flexible and allows you to do things in your favorite programming language (rather than depending on Rivescript).

Bulk extract with Authenticated Connector (import.io)

I am new to import.io and this forum.
I am trying to extract information from a target database where I have to run a query with an input. With help of the support, I successfully created the authenticated connector. With multiple inputs that have to be manually entered in the UI, it fetches the data properly.
The problem is I have more than 10,000 inputs to run, so it has to be in a form of bulk extraction. import.io support told me that they do not have this feature within their UI and suggested to use their API posted in here: http://api.docs.import.io/#!/Query_Methods/queryPost.
Could anyone walk me through to make a use of this? I just need a working script that takes multiple string lines as inputs and run the connector that I built and post the result. I am not very familiar with this kind of technology but I am very willing to learn.
Thanks all in advance!
I would be happy to walk you through a bit of an into. It will be a bit basic though since I don't know your specific use case.
Yes, support was correct. You will need to use the POST query in order to pass your authentication credentials as inputs.
I will break down this query by steps. Essentially, our API docs are just a simple UI to pass through your credentials, then you can generate a query API.
ID - This is the GUID of your connector. This information can be found at the end of the URL, like this: https://import.io/data/mine/?tag=CONNECTOR&id=33f4e828-25ce-40c4-948c-9b734c70d1ab
Query - This is where you will put the inputs from your connector in order to execute. Be sure to keep this in structured JSON or it will bring back errors when you are querying.
Once you have successfully entered that information you will query the API.
This will give you the request URL that you need to query the API.
If you have anymore questions, just let me know.
Thanks,
Meg

Displaying documents SP2013 SharePoint Hosted App Model

So what are the cool kids using for displaying documents inside a SharePoint Hosted App Model? Right now, I'm doing rest calls and attempting to display the data using jquery datatables plugin. It works but isn't exactly usable, not to mention that I have to make additional async calls to get Author names, etc.
Should I dump REST and use CSOM and format the data accordingly? Build the hyperlink to the item, format date, build Author name.
Seems like I'm re-inventing the wheel here and want to make sure that I'm not overlooking something obvious.
Thanks
Out of interest, what about DataTables is not usable? If the data is in the JSON return, it can obtain the data directly. Sorry, I know this doesn't help you, but I'm trying to make DataTables better, so I'm interested to know what use cases it is failing to deliver on at the moment!

create query using webservice api for Rally

I am trying to write a query in Ruby to insert a user story in Rally using WSAPI. I read through https://rally1.rallydev.com/slm/doc/webservice/.I looked it up and found that wsapi has a create() method, but I am not aware of its signature. I know it uses PUT/Post method for creation, but I just need an example to understand how to write create queries. Does anyone know of any useful resource to know more about this? I have all my code ready, just need information about writing "create" queries using Rally's WSAPI.
Thanks
There is a full directory of Ruby REST examples in the Github Repository for RallyRestToolkitForRuby:
https://github.com/RallyTools/RallyRestToolkitForRuby/tree/master/examples
This create example may be of particular interest. It's for a Defect, but the same logic would apply to Stories:
04-create-defect.rb